-3

我想知道如何查询这个结构:我怎么能

SELECT only 1 ID FROM portfolio 
WHERE category = "x" AND DISTINCT description = 'x'?

(表名和字段)

portfolio:
ID, client, section, category, description, year, files

编辑:谢谢你的回答。

4

3 回答 3

1
SELECT MAX(ID)
FROM profolio
WHERE category = 'x' AND description = 'x'
于 2012-12-18T05:41:19.547 回答
0

您可以在 mysql 中使用 limit 语句,如下所示。

select id from portfolio where category='x' and description='x' limit 1 offset 0
于 2012-12-18T05:42:02.743 回答
0
SELECT ID from portfolio WHERE category = 'x' AND description = 'x' LIMIT 1;
于 2012-12-18T05:42:07.250 回答