SQL一个字段多个值的查询语句怎么写,并且查询的结果必须同时满足这多个值

我做的是标签筛选,希望能够筛选出同时拥有多个标签的文章。
2025-12-15 15:57:39
推荐回答(3个)
回答1:

select * from 表名 
    where charindex('查询值1',字段名) >0
    and charindex('查询值2',字段名) >0 
    and charindex('查询值3',字段名) >0
    and .......

回答2:

同时满足的话用and在where 条件1 and 条件2

回答3:

where 列名 = ? and 列名 = ?...