For så kan der laves i SQL og tælle det sammen sådan her:
SQL = "SELECT Count(farve) as antal, farve FROM tabel GROUP BY farve ORDER BY Count(farve) DESC" Set rs = Conn.Execute(SQL) do while not rs.EOF Response.write rs("farve") & " " & rs("antal") rs.Movenext loop
...og koden: SQL = "SELECT Count(farve) as antal, farve FROM tester_colors GROUP BY farve ORDER BY Count(farve) DESC" Set objRS = objConn.Execute(SQL) do while not objRS.EOF Response.write objRS("farve") & " " & objRS("antal") objRS.Movenext loop
'SQL = "SELECT Count(farve) as antal, farve FROM tester_colors GROUP BY farve ORDER BY Count(farve) DESC" SQL = "SELECT Count(farve) as antal, farve FROM tester_colors GROUP BY farve"
Man lukker et spørgsmål ved at acceptere et eller flere svar, så det har du sådan set gjort :)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.