[RESOLVED] subquery problem thanks for help
Hi all,
I have 3 tables.
I want select data from 1 of the table but and using subquery to select another 2 value from another 2 tables.
actually i want to do a comparison if table A Type = 'E' then select from Table B if Type ='S' select from Table C.
How do I accomplish this ?
Thanks a million!
Re: subquery problem thanks for help
Which database? What are the table structures? Can they be linked?
If TableA can be linked to Tables B and C, then simple Left Joins would work.
In SQL Server you could also use something like
Select Case Type
When 'E' Then (Select....)
When 'S' Then (Select...)
Else Null End As ColumnName,
Other Columns...
From TableA
Re: subquery problem thanks for help
Thanks bruve you solved my problem but I need to put a "(" before select and ")" after End.
really appreciate....
(Select Case Type
When 'E' Then (Select....)
When 'S' Then (Select...)
Else Null End) As ColumnName,
Other Columns...
From TableA