MySQL Forums
Forum List  »  Optimizer & Parser

Re: Can we write one query instead of following three query?
Posted by: Rick James
Date: July 11, 2010 11:47PM

What's wrong with 3 SELECTs?

I hope you have
INDEX(ZIP, STATUS)

You could do
SELECT
   ( SELECT COUNT(*) ... ) AS Avaialble,
   ( SELECT COUNT(*) ... ) AS SoldRent,
   ( SELECT COUNT(*) ... ) AS Pending
;
(but I don't see any advantage)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Can we write one query instead of following three query?
1284
July 11, 2010 11:47PM


Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.