これは、2つのテーブルを結合するために使用しているクエリです
SELECT `rf_popup`.*
FROM `rf_popup` LEFT JOIN
`g_metadata` ON (`rf_popup`.`name` = `g_metadata`.`name`)
WHERE (`g_metadata`.`g_id` = '2009112305475443' AND
`g_metadata`.`value` < rf_popup.cardinality OR
`g_metadata`.`g_id` IS NULL) AND
`category` IN ('S', 'all') AND
`field` IN ('descr', 'all') AND
`filler_type` IN ('F2', 'all')
ORDER BY `rf_popup`.`priority` DESC LIMIT 5
これはテーブルです rf_popup
+--------------+------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+------------------------------------------------------------------------------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(200) | YES | | NULL | |
| text | text | YES | | NULL | |
| cardinality | int(11) | NO | | 1 | |
| field | varchar(200) | YES | | NULL | |
| category | enum('A','H','N','R','S','D','all') | YES | | NULL | |
| time_to_show | enum('START','END') | YES | | START | |
| filler_type | enum('F1','F2','F3','R1','R2','R3','all') | YES | | FILLER1 | |
| priority | int(11) | NO | | 0 | |
+--------------+------------------------------------------------------------------------
------------+--------+-----+---------+-------------- --+
これはTABLE g_metadataです
+-------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+----------------+
| g_id | varchar(50) | YES | MUL | NULL | |
| name | varchar(50) | YES | MUL | NULL | |
| value | varchar(200) | YES | | NULL | |
| id | int(11) | NO | PRI | NULL | auto_increment |
+-------+--------------+------+-----+---------+----------------+
しかし、クエリは空の結果を返します。しかし、WHERE
クエリをAND
. クエリは結果を返します。違いは何ですか?? 違いはないはずなので、混乱しています