Link to home
Start Free TrialLog in
Avatar of JameMeck
JameMeckFlag for United States of America

asked on

MS SQL 2005 merge data.

A = 1
B = 3

select * from myTable where myColumn = A.
--> return 2 record:
0.080
0.097


select * from myTable where myColumn = B
--> return 1 record:
0.234


How can I merge them into 1 data table:
0.080
0.097
0.234

I don't want to use this query:
select * from myTable where myColumn = A or myColumn = B.

Please help me.

Avatar of jimyX
jimyX

You can use IN:
select * from myTable where myColumn in (A, B)

If you do not mind me asking, why you do not want to use AND?
I meant OR
ASKER CERTIFIED SOLUTION
Avatar of Asim Nazir
Asim Nazir
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
select * from myTable where myColumn in (A,B).
>I don't want to use this query:
why not?

you might want to read this article:
https://www.experts-exchange.com/A_1536.html