Ciao,
Ho una select tipo questa
SELECT DISTINCT `country`
FROM `nations`
GROUP BY `country`
be vorrei avere Italy al primo posto
è possibile ?
![]()
Ciao,
Ho una select tipo questa
SELECT DISTINCT `country`
FROM `nations`
GROUP BY `country`
be vorrei avere Italy al primo posto
è possibile ?
![]()
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it
Visto che raggruppi l'uso di distinct è superfluo.codice:SELECT country FROM nations GROUP BY country ORDER BY IF(country='italy',0,1),country![]()
![]()
EDIT
PS
che tu sappia è + performante group by o distinct ?
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it
Non saprei. Non mi sono mai posto il problema.![]()
Per abitudine più che altro se posso farne a meno evito di usare distinct.
e fai beneOriginariamente inviato da nicola75ss
Non saprei. Non mi sono mai posto il problema.![]()
Per abitudine più che altro se posso farne a meno evito di usare distinct.
Don't use DISTINCT when you have or could use GROUP BY
http://forge.mysql.com/wiki/Top10SQLPerformanceTips
![]()
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it