how i can create a query for next case: i have few types: posts, comments, users and other And need search by room_id IN(1,2,3,4) and query = *** But if field room_id not exist - just skip it. For example type "user" without room_id and i whant select all user data only by query. But if this field exist - then check room_id
I use PHP + Yii2, but native code will be ok too
How create this query? Thanks
PS: more simple description need select data from different types, by different conditions Example: Select * from post, comment, user where (post.id > 10 OR comment.count <30 OR user.age = 15) AND title = 'test'