mysql - How do I merge these two queries together? -


select min( a.severity ), concat_ws(",", a.dev_id, a.object_id ) tuple  net.alerts inner join net.deviceinfo c on c.id = a.dev_id ,  c.peer = ( select value local.settings setting="server_id" ) 1  , (a.dev_id, a.object_id) in ( (13,4164),(45,-1),(145,995),(188,-1) ) group tuple   select min( a.severity ), concat_ws(",", b.device_id, b.object_id ) tuple  net.alerts inner join local.conditions b on a.condition_id = b.condition_id 1  and(b.device_id, b.object_id) in ((13,4164),(45,-1),(145,995),(188,-1) ) group tuple 

i have these tables, , in alerts , conditions tables, have device_id , object_id, maybe different, i'm trying retrieve data of composite.

i'm not sure understand try guess need use union.

by way why write where 1 , condition , not where condition ?


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

wso2esb - How to concatenate JSON array values in WSO2 ESB? -