for question, have 2 tables.
tb1 names cases
tb2 names calls
have select case calls contain status in ('a','b')
example:
case has 3 calls.
call a.1 has status a
call a.2 has status a
call a.3 has status b
case b has 3 calls.
call b.1 has status a
call b.2 has status b
call b.3 has status c
so, query should return case because in case calls status in ('a','b')
my query return case record contain call status not , b c. it's not correct
select c.id cases c join calls ca on (ca.parent_id = c.id , ca.parent_type = 'cases') c.status <> 'closed' , ca.status in ('a','b') group c.id
could me, please?
thanks,
may
select cs.* cases cs join calls cl on cl.caseid = cs.title , cl.status in ('a', 'b');
Comments
Post a Comment