We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

MS SQL 2005 merge data.

JameMeck
JameMeck asked
on
Medium Priority
517 Views
Last Modified: 2012-05-11
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.

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2011

Commented:
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?
CERTIFIED EXPERT
Top Expert 2011

Commented:
I meant OR
Project Manager
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Alpesh PatelSolution Architect at TCS (SAFe®Agilist, TOGAF® Foundation, PSM I®, MCP, MCSD)
CERTIFIED EXPERT

Commented:
select * from myTable where myColumn in (A,B).
Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
>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
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.