oracle - SQL - Combining two queries -
oracle - SQL - Combining two queries -
in sql have wrote these 2 queries:
query 1:
select hotelid, hotelname, email hotel hotelid in (select branch.hotelid branch branchaddress '%london%');
query 2:
select branch.hotelid, count(*) branch grouping hotelid having count(*) > 5;
i ideally combine these 2 queries together, results generated based on either of these two.
how go doing this? thought union used not sure if right method use.
select a.hotelid, a.hotelname, a.email, count(*) hotel bring together branch b on a.hotelid = b.hotelid b.branchaddress '%london%' grouping a.hotelid, a.hotelname, a.email having count(*) > 5
sql oracle
Comments
Post a Comment