我想知道如何查询这个结构:我怎么能
SELECT only 1 ID FROM portfolio
WHERE category = "x" AND DISTINCT description = 'x'?
(表名和字段)
portfolio:
ID, client, section, category, description, year, files
编辑:谢谢你的回答。
SELECT MAX(ID)
FROM profolio
WHERE category = 'x' AND description = 'x'
您可以在 mysql 中使用 limit 语句,如下所示。
select id from portfolio where category='x' and description='x' limit 1 offset 0
SELECT ID from portfolio WHERE category = 'x' AND description = 'x' LIMIT 1;