Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting 1 record of each letter! 1

Status
Not open for further replies.

MrBelfry

IS-IT--Management
May 21, 2003
289
I have a msql db that holds info about album names. I want to extract data from the table so I can see if i have reviewed an album beginning with that letter.

I dont want to execute 26 queries checking for letters so I'd like to do 1 query and extract all the relevant data BUT i don't want to include more than 1 review if I've already got one beginning with the same letter.

I hope that is clear, can you please help?

Thanks

MrBelfry
 


[tt]select left(albumname,1) as letter
, count(*) as albumsreviewed
from yourtable
group
by letter
order
by letter [/tt]


rudy
http:?/r937.com/
 
Thanks

For you a star is born!

MrBelfry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top