如何使用多个类别加入 BETWEEN 语句和 AND 语句?
SELECT * FROM quick_inquiry WHERE inquiry_time BETWEEN '$start' AND '$end' AND
inquiry_language LIKE '%$language%' AND
service_country LIKE '%$country%' AND
category LIKE '%$category%' AND
replied LIKE '%$replied%'
答案 0 :(得分:1)
试试这个:
SELECT * FROM quick_inquiry
WHERE (inquiry_time BETWEEN '$start' AND '$end')
AND inquiry_language LIKE '%$language%'
AND service_country LIKE '%$country%'
AND category LIKE '%$category%'
AND replied LIKE '%$replied%'
您也可以使用> =和< =
SELECT * FROM quick_inquiry
WHERE inquiry_time >= '$start'
AND inquiry_time <= '$end'
AND inquiry_language LIKE '%$language%'
AND service_country LIKE '%$country%'
AND category LIKE '%$category%'
AND replied LIKE '%$replied%'