mocanu silviu wrote:

>mocanu silviu wrote:
>  
>
>Raspunsul corect (si logic) era:
>
>mysql> SELECT ID,tool, COUNT(tool) FROM tools WHERE (tool='abc' OR 
>tool='def') GROUP BY tool HAVING `count(tool)`=2;
>+-------------+------+-------------------+
>|           ID   | tool  | COUNT(tool) |
>+-------------+------+------------------+
>|          25    |  def  |           2           |
>+-------------+------+------------------+
>1 row in set (0.00 sec)
>
>  
>
gresit...
a) group by id; tool nu trebuie sa fie selectat decit cu count()
b) pot sa am 2 inregistrari cu 'abc', care vor fi incorect raportate de 
query

--- 
Detalii despre listele noastre de mail: http://www.lug.ro/


Raspunde prin e-mail lui