SELECT * from vehicle_adv_details
LEFT JOIN vehicle_description on vehicle_adv_details.id=vehicle_description.vehicleid
LEFT JOIN vehicle_extras on vehicle_adv_details.id=vehicle_extras.vehicleid
LEFT JOIN vehicle_technical_features on vehicle_adv_details.id=vehicle_technical_features.vehicleid
LEFT JOIN vehicle_photo on vehicle_adv_details.id=vehicle_photo.vehicleid
) UNIONALL
(SELECT * FROM propertysale_adv_details
LEFT JOIN propertysale_adv_description ON propertysale_adv_details.id = propertysale_adv_description.propertysalesid
LEFT JOIN propertysale_adv_listeragent ON propertysale_adv_details.id = propertysale_adv_listeragent.propertysalesid
LEFT JOIN propertysale_adv_listerowner ON propertysale_adv_details.id = propertysale_adv_listerowner.propertysalesid
LEFT JOIN propertysale_adv_photos ON propertysale_adv_details.id = propertysale_adv_photos.propertysalesid
) UNIONALL
(SELECT * from propertyrent_adv_details
LEFT JOIN propertyrent_description on propertyrent_adv_details.id=propertyrent_description.propertyrentid
LEFT JOIN propertyrent_landlord_details on propertyrent_adv_details.id=propertyrent_landlord_details.propertyrentid
LEFT JOIN propertyrent_photo on propertyrent_adv_details.id=propertyrent_photo.propertyrentid
WHERE advtitle LIKE '%villa%'
)
WHERE advtitle LIKE '%villa%' OR kilometer LIKE '%villa%'
OR price LIKE '%villa%' OR description LIKE '%villa%'
答案 0 :(得分:0)
advtitle
kilometer
price
和description
列如何具有不同的类型和内容只是LIKE
一个常量字符串villa
!
villa
是你的适用条件的神奇字词吗?