Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi all

how do select from select result in sql ...

example :

SQL
select * from customer

=
SQL
one 
two
three


Now , How Do Select From Above Result For Example I Want Top 2 Record

thanks a lot
Posted

for selecting top two records :
SQL
select top 2 * from customer

is enough

or try :
SQL
select top 2 * from (select * from customer)a


in your case all you need is to use subquery , search and learn from google more
 
Share this answer
 
v4
Comments
Reza Ahmadi 19-Apr-12 7:16am    
5!
member60 19-Apr-12 7:57am    
thank you
Uday P.Singh 19-Apr-12 7:41am    
5!
member60 19-Apr-12 7:57am    
thank you Uday
VJ Reddy 23-Apr-12 19:24pm    
To the point. 5!
I think what you are looking for is the IN keyword. Have a look at the link below and let me know if thats what you want.

http://www.w3schools.com/sql/sql_in.asp[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900