Click here to Skip to main content
15,891,670 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My Query is


SQL
SELECT distinct b.NAME_ORGN,c.QUES_DESC,a.ANSWER,b.ORGN_TYPE FROM TT_CFFEDBACK_REPLY a,TT_CFFEDBACK b,tm_question_bank c where b.QUES_NO=c.QUES_NO and a.QUES_NO=b.QUES_NO and a.QUES_NO=c.QUES_NO and b.ORGN_TYPE=c.ORGN_TYPE and to_date(a.ACCEPT_DATE,'dd-mm-rr')>='" + datefrom_changed + "'and to_date(a.ACCEPT_DATE,'dd-mm-rr')<'" + dateto_changed + "' and c.QUES_DESC='" + DropDownList3.SelectedValue + "' and c.ORGN_TYPE='AIRLINES'
Posted
Updated 3-Jun-13 1:15am
v2
Comments
Maciej Los 3-Jun-13 7:27am    
Is it Oracle database?

1 solution

Use TOP or LIMIT or ROWNUM

Refer: http://www.w3schools.com/sql/sql_top.asp[^]
 
Share this answer
 
Comments
Thanks7872 3-Jun-13 7:30am    
Upvoted....concise and clear as well...!
Rohit 2012 3-Jun-13 7:39am    
it is working sir..........but sir my rows are repeating .i got my result bt it repeating everytime

for ex


name roll no

rohit 3

rohit 3

rohit 3

arvind 4

arvind 4

arvind 4

sachin 5

sachin 5

sachin 5


i want only

Name Roll no

Rohit 3

arvind 4

sachin 5
Rohit 2012 3-Jun-13 7:56am    
plz help sir.............
Prasad_Kulkarni 3-Jun-13 8:02am    
Try with SELECT DISTINCE TOP 3 <--your query as it is-->
Rohit 2012 3-Jun-13 8:10am    
thanx 4 yr quick response sir.........bt it is not working

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