+ 2
Sql question !
the query below..the result will show just one record because of the MIN function ?? : SELECT name, MIN (cost) from items where name like '%book' AND seller_id IN (68,6,18);
2 Respuestas
+ 7
Yes, the aggregation functions (sum, min, max, avg, count, etc.) only result in 1 row. If you use them with "group by" then each row for a "group".
+ 1
As long as I know: Yes.
But a bit more simple would be:
SELECT name, cost FROM items WHERE name LIKE '%book' AND seller_id IN (68,6,18) ORDER BY cost LIMIT 1;
(the default ORDER BY is ascending)