dbTalk Databases Forums  

group by query with string manipulation

mailing.database.myodbc mailing.database.myodbc


Discuss group by query with string manipulation in the mailing.database.myodbc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
 
Posts: n/a

Default group by query with string manipulation - 07-06-2003 , 03:53 PM






------=_NextPart_000_0021_01C343DF.28894A80
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I'm running this query to get a count of categories I have in a field =
that contains aircraft categories.

SELECT substring(category,10), count(*)
FROM `links` where category like 'Aircraft/Sales%'
group by category order by category

and getting these results:

---------------------------
Sales/Dealers 7
Sales 203


I would like to get these results:

-------------------------------------
Sales 210


but am not sure how to manipulate the category field to do this. Thanks =
in advance.



------=_NextPart_000_0021_01C343DF.28894A80--


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.