Selecting DISTINCT Records
Posted: Mon Nov 22, 2010 9:05 am
Hello everyone!
I Want to ask that how can i do this.
1) This is my table (StudentInfo) in database
Name Age Ph. No. Address
Abc 12 0000 Street1
Pqr 13 4444 Street2
Xyz 12 6666 Street3
Pqr 13 4444 Street2
Pqr 13 4444 Street2
2) I want to pick up DISTINCT records based on Age Field. However i can use
"SELECT DISTINCT Age FROM StudentInfo"
But this way i can only fetch the Age Field. How can I fetch the rest of the fields namely Name, Ph. No., Address.
Suggestions Appreciated
Regards
I Want to ask that how can i do this.
1) This is my table (StudentInfo) in database
Name Age Ph. No. Address
Abc 12 0000 Street1
Pqr 13 4444 Street2
Xyz 12 6666 Street3
Pqr 13 4444 Street2
Pqr 13 4444 Street2
2) I want to pick up DISTINCT records based on Age Field. However i can use
"SELECT DISTINCT Age FROM StudentInfo"
But this way i can only fetch the Age Field. How can I fetch the rest of the fields namely Name, Ph. No., Address.
Suggestions Appreciated
Regards