I have a table in a mysql db:
[HTML]
NAME ROLE DATE TYPE
MARK STR 2008-04-28 B
KARL MAN 2008-04-28 A
KARL IRE 2008-04-28 A
JIM IRE 2008-04-28 A
PATTY MAN 2008-04-28 C
PATTY STR 2008-04-28 C
[/HTML]
On this table execute this query:
Expand|Select|Wrap|Line Numbers
- SELECT
- COUNT(TYPE) AS tot
- FROM tbl_1
- WHERE DATE BETWEEN '2008-04-28' AND '2008-04-28'
- GROUP BY TYPE, DATE
- ORDER BY DATE
NR 1 row for TYPE = B
NR 3 row for TYPE = A
NR 2 rows for TYPE = C
As you can see the column NAME actually contains 4 names divided by ROLE.
I want the query counts once the name:
NR 1 row per TYPE = B ( NAME = MARK )
NR 1 row per TYPE = A ( NAME = KARL )
NR 1 row per TYPE = A ( NAME = JIM )
NR 1 row per TYPE = C ( NAME = PATTY )
Then 4 rows finals, instead of 6 extracts now with the query, which also counts double names.
It's possible ?
Thanks x your attention
Viki