AND内部的OR仅评估其中一个OR条件

时间:2015-08-24 17:15:21

标签: sql oracle

现在我的查询类似于

SELECT
   table1.column1,
   table2.column2,
   table1.column3
FROM
   table1
   table2
WHERE
   table1.column3 > SYSDATE
   AND ((table1.column1 = 'STRING1') OR (table2.column2 LIKE 'STRING2'))

此查询仅返回符合以下内容的记录:

table2.column2 LIKE 'STRING2'

它应该返回不符合该条件但仍满足的值:

table1.column1 = 'STRING1'

我的逻辑搞砸了,还是我做错了什么?

1 个答案:

答案 0 :(得分:0)

如果我理解你的解释:

Parameters: {"utf8"=>"✓",   "authenticity_token"=>"e3DrDAhJPV4vgma9tg7wk9g589ZRDNInynWlXDv7oJQ=", "user"=>  {"avatar"=>#<ActionDispatch::Http::UploadedFile:0x007f8784a00ec0 @tempfile=#  <Tempfile:/var/folders/83/2r02tq2d3934d30syfmpz9yw0000gn/T/RackMultipart20150825-  4587-14jh732>,   @original_filename="10920917_10152994488342090_418253413398867864_n.jpg",   @content_type="image/jpeg", @headers="Content-Disposition: form-data;   name=\"user[avatar]\";   filename=\"10920917_10152994488342090_418253413398867864_n.jpg\"\r\nContent-Type:   image/jpeg\r\n">}, "commit"=>"Upload"}