如何在单个表中获取此查询的输出
bool setLess(const MySet &, const MySet &)
答案 0 :(得分:0)
看看这是否适合您。只需添加您自己的ON条件而不是我的biocard.pk = inventory_listing.fk
。我不知道在桌子上加入什么。
SELECT
common_name,
category,
size,
container,
flower_image,
price,
bio_Count.total_quantity
FROM
biocard join inventory_listing
ON
biocard.pk = inventory_listing.fk LEFT JOIN (SELECT
common_name,
count(*) as total_quantity
FROM
biocard
GROUP BY
common_name) bio_Count
ON
bio_Count.common_name = biocard.common_name