如何解决PL / SQL中的运算符AND和OR
我有以下查询,并且收到的电影流派与Action
不同。
SELECT original_title,genres
FROM movies
WHERE cast LIKE('%Daniel Craig%')
OR cast LIKE('%Christoph Waltz%')
AND genres LIKE('%Action%');
我只想查看包含动作的类型。 这就是我现在看到的:
Spectre Action|Adventure|Crime
Inglourious Basterds Drama|Action|Thriller|War
Lara Croft: Tomb Raider Adventure|Fantasy|Action|Thriller
Quantum of Solace Adventure|Action|Thriller|Crime
Defiance Action|Drama|History|War
Flashbacks of a Fool Drama
The Girl with the Dragon Tattoo Thriller|Crime|Mystery|Drama
Cowboys & Aliens Action|Science Fiction|Thriller|Western
The Green Hornet Action|Crime|Comedy
Dream House Drama|Thriller|Mystery
One Life Family|Documentary
Skyfall Action|Adventure|Thriller
亲切的问候, 安娜
解决方法
是引起问题的OR
。应该应该是
SELECT original_title,genres
FROM movies
WHERE ( cast LIKE('%Daniel Craig%')
OR cast LIKE('%Christoph Waltz%')
)
AND genres LIKE('%Action%');
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。