asp语句问题

来源:百度知道 编辑:UC知道 时间:2024/05/24 15:11:51
查找gongqiu表stype=货物 bs等于吉安或smalllocationT=吉安是这样写吗?怎么没用?

select * from gongqiu where stype='货物'and bs='吉安' or smalllocationT='吉安' order by ID DESC

如果这是SQL 语句的话 是对的啊

select * from gongqiu where stype='货物'and gongqiu.ID in(select gongqiu.ID from gongqiu where bs='吉安' or smalllocationT='吉安') order by ID DESC

select * from gongqiu where stype='货物'and gongqiu.ID in(select gongqiu.ID from gongqiu where bs='吉安' or smalllocationT='吉安') order by ID DESC 这句正确的,select * from gongqiu where stype='货物'and bs='吉安' or smalllocationT='吉安' order by ID DESC这里面如果smalllocationT='吉安'那stype可以不为'货物'也是符合条件的