Hi,
Table A
Col1 Col2 Col3 Col4
Table B
Col5
Both tables are not linked to each other.
Table 5 have Values (10, 17, 30) Only.
Query
I am currently executing query in the following way
Select Col1, Col2, Col3, Col4, 10 From TableA where Col4 = '2008-08-10';
Select Col1, Col2, Col3, Col4, 17 From TableA where Col4 = '2008-08-10';
Select Col1, Col2, Col3, Col4, 30 From TableA where Col4 = '2008-08-10';
I want to make one query so that I dont have run this statement thrice.
If I use union then have to change these dates and other conditions three times.
Select Col1, Col2, Col3, Col4, 10 From TableA where Col4 = '2008-08-10'
Union
Select Col1, Col2, Col3, Col4, 17 From TableA where Col4 = '2008-08-10'
Union
Select Col1, Col2, Col3, Col4, 30 From TableA where Col4 = '2008-08-10'
Is there a way I can get one SQL Statement which does the work which this statement isw doing (UNION ONE). Just tot avoid changing conditions every where.
Thanks
Rohit