Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I write this sub query in MySQL???

Status
Not open for further replies.

danielrc15

Programmer
Sep 18, 2003
6
GB
HI,

I have this subquery written in Oracle SQL, can anyone tell me how to write it in MySQL v3 syntax? Thanks Daniel

select count(a.id), (a.vl)
from rqf_16_4_40_tce_test a
where a.vl < 40000
and a.id IN (select id from rqf_16_4_40_tce_test_mut b where b.region_name = 'PR' and mutation='49Y')
and a.id IN (select id from rqf_16_4_40_tce_test_mut b where b.region_name = 'RT' and mutation='45Y')
group by a.vl
 
[tt]select count(a.id)
, a.vl
from rqf_16_4_40_tce_test a
inner
join rqf_16_4_40_tce_test_mut b
on a.id = b.id
where a.vl < 40000
and ( ( b.region_name = 'PR' and mutation='49Y' )
or ( b.region_name = 'RT' and mutation='45Y' )
)
group
by a.vl[/tt]

rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top