SELECT count( 0 ) FROM ( SELECT *, mt.product_id AS productId FROM mrp_tryout mt WHERE mt.company_id = 1 GROUP BY mt.product_id ) table_count
时间: 2024-04-10 18:30:51 浏览: 121
SELECT 的另类用法
您的问题是:查询一个表中不重复的产品数量吗?
如果是的话,您可以使用以下SQL语句:
SELECT COUNT(0)
FROM (
SELECT *, mt.product_id AS productId
FROM mrp_tryout mt
WHERE mt.company_id = 1
GROUP BY mt.product_id
) AS table_count;
阅读全文