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
Selecting DISTINCT Records
Moderator: General Moderators
Selecting DISTINCT Records
Last edited by amplifire on Mon Nov 22, 2010 9:08 am, edited 1 time in total.
Re: Selecting DISTINCT Records
Code: Select all
SELECT *, DISTINCT(Age) FROM StudentinfoRe: Selecting DISTINCT Records
Thanx Celauran!!
I found it, should go like this
I found it, should go like this
SELECT DISTINCT Age,Name,Address FROM StudentInfo.