|
Posted by IchBin on 10/05/10 11:58
vito wrote:
> I have the following table in mysql:
>
> id | description
> 1 | some text1
> 1-A |
> 2 | some text1
> 3 | some text3
> 3-A |
>
> I must count number of record that have tha same value with row
> "description"
> and additionally record 1-A is the same description like 1 and 3-A is the
> same like 3
> (but default there are empty).
>
> For example numer of records with "some text1" descriptions are 3 (1,1-A,2).
> It is possible to do it with only mysql query?
>
>
If I understand you correctly:
select id,description,count(*) from table group by SUBSTRING( id, 1,1);
--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Navigation:
[Reply to this message]
|