Jump to content
php.lv forumi

Admini


FireFox

Recommended Posts

izvilks admina niku un ierakstu skaitu ar šo niku tabulā (var izmantot, lai noteiktu cik ir katrs banojis)

 

SELECT admina_niks, COUNT(admina_niks) FROM bani GROUP BY admina_niks

 

Man nesen ar bija problēma ar tādu sarežģītu query...

Tas otrs ir grutāks, bet, pēc manām domām, izskatītos šādi.

 

SELECT bani.admina_niks, summary.banu_skaits FROM (SELECT admina_niks, COUNT(admina_niks) AS banu_skaits FROM products GROUP BY admina_niks) summary, bani WHERE summary.admina_niks = bani.admina_niks ORDER BY summary.banu_skaits DESC LIMIT 10

Link to comment
Share on other sites

×
×
  • Create New...