Results 1 to 2 of 2

Thread: bundling more than 1 query into 1 query

  1. #1
    Join Date
    Jul 2010
    Posts
    1

    bundling more than 1 query into 1 query

    Hi,
    I have 3 different sql queries.

    1. select x,count(*) from tab where x in (a,b,c) and y<100 group by x
    2. select x,count(*) from tab where x in (a,b,c) and y between 100 and 200 and z< 10 group by x
    3. select x, count(*) from tab1 where x in (a,b,c) and y > 100


    My question is can the above three queries be written in a single query?

  2. #2
    Join Date
    Aug 2010
    Posts
    1
    Yes you can do it using INNER JOIN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •