Hello,
I have a data like this:
ID Program Status
1 Fed AP
1 Stt AP
2 Cal AP
2 Stt DN
3 Fed AP
I want my data to be :
ID Program Status Stt_Status
1 Fed AP AP
2 Cal AP DN
3 Fed AP Null
On ID=3, there isn't any Stt; therefore, I want it to display Null
Here is my query:
Select a.ID,
a.Program,
a.status,
b.stt_status
from table a, table a on (a.ID=b.ID)
and a.Program in (Fed, Cal)
and b.Program='Stt'
I am missing ID=3. What am I doing wrong?
Thank you.
Chaoma
I have a data like this:
ID Program Status
1 Fed AP
1 Stt AP
2 Cal AP
2 Stt DN
3 Fed AP
I want my data to be :
ID Program Status Stt_Status
1 Fed AP AP
2 Cal AP DN
3 Fed AP Null
On ID=3, there isn't any Stt; therefore, I want it to display Null
Here is my query:
Select a.ID,
a.Program,
a.status,
b.stt_status
from table a, table a on (a.ID=b.ID)
and a.Program in (Fed, Cal)
and b.Program='Stt'
I am missing ID=3. What am I doing wrong?
Thank you.
Chaoma