Items
からすべてのアイテムを選択できます およびLEFT JOIN
MyTbl
共通のItemID
、一致を数える;
select
Items.itemId,
count(MyTbl.itemId) as count
from Items
left join MyTbl on (MyTbl.ItemID = Items.ItemID)
group by Items.itemId
order by Items.itemId
Items
からすべてのアイテムを選択できます およびLEFT JOIN
MyTbl
共通のItemID
、一致を数える;
select
Items.itemId,
count(MyTbl.itemId) as count
from Items
left join MyTbl on (MyTbl.ItemID = Items.ItemID)
group by Items.itemId
order by Items.itemId