Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Where Clause with Group by and Order by within the MY SQL forums, part of the Databases category; Can we use Where clause with Group by Or Order By? If yes, Also can we use all three clause in a single query...
|
|||||||
|
|||
|
Re: Where Clause with Group by and Order by
Yes
Yes you can also use having clause with the other three clauses. sample code Code:
SELECT product_type_id, AVG(price) FROM products WHERE price < 15 GROUP BY product_type_id HAVING AVG(price) > 13 ORDER BY product_type_id; |
| The Following 2 Users Say Thank You to debasisdas For This Useful Post: | ||
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Join two tables and apply group by clause | Geek_Guest | SQL | 3 | 06-18-2009 02:53 PM |
| SQL Order By Clause | rijus | SQL | 3 | 06-04-2009 04:10 AM |
| Group level data item in WHERE clause | kulkarte | DB2 | 3 | 04-04-2009 10:18 AM |
| Group by and order by | jainbrijesh | SQL Server | 4 | 01-23-2008 12:22 AM |
| Output port and Group by clause in SQ | JobHelper | Data Warehousing | 1 | 01-04-2007 12:17 PM |