webForumDet fria alternativet

MySQL: Antal av en sort!

2 svar · 241 visningar · startad av Sjodahl

SjodahlMedlem sedan maj 20033 218 inlägg
#1

Hej!

Liten MySQL fråga:

Har en tabell enligt nedan:

tbl01:
ID
ArtID

Det jag vill ha ut är hur många av de olika ArtID det finns:

tex:
ArtID:17 (12st)
ArtID: 13 (10st)
ArtID: 3 (23st)

SELECT * FROM tbl01 GROUP BY ArtID (fast saknas något hehe )

@ndersMedlem sedan juni 200032 969 inlägg
#2
SELECT ArtID, COUNT(*) AS Antal GROUP BY ArtID
SjodahlMedlem sedan maj 20033 218 inlägg
#3

gjorde ju så "nästan" först ;)

tackar!

130 ms totalt · 3 externa anrop · v20260731065814-full.30151723
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
126 ms — hämta tråd, inlägg och bilagor (db)