Home » Other » Training & Certification » Group by having
Group by having [message #317808] Sat, 03 May 2008 17:08 Go to next message
himesh
Messages: 5
Registered: May 2008
Junior Member
Hi,

If i need to query two tables using the group by having clause, how is the code written?

would the following work?

SELECT column,SUM(column) FROM table and table
GROUP BY column
HAVING SUM(column) condition value
Re: Group by having [message #317809 is a reply to message #317808] Sat, 03 May 2008 17:14 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>would the following work?
No

http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#sthref9696
Re: Group by having [message #317810 is a reply to message #317809] Sat, 03 May 2008 17:22 Go to previous messageGo to next message
himesh
Messages: 5
Registered: May 2008
Junior Member
thanks for your help but being a noob, i am completly useless at the whole sql thing! also the link that you gave me did not cover querying two tables using the group by having clause
Re: Group by having [message #317811 is a reply to message #317808] Sat, 03 May 2008 17:35 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>the link that you gave me did not cover querying two tables using the group by having clause
Wrong.
This fine manual describes how to construct EVERY valid SELECT statement.
You just need to learn how to read & understand what is contained in it.

Is GOOGLE broken for you?
Results 1 - 10 of about 1,970,000 for select having group by

[Updated on: Sat, 03 May 2008 17:43] by Moderator

Report message to a moderator

Re: Group by having [message #317812 is a reply to message #317808] Sat, 03 May 2008 17:51 Go to previous messageGo to next message
himesh
Messages: 5
Registered: May 2008
Junior Member
yes, google is broken for me, i must be too stupid to search for something!
Re: Group by having [message #317813 is a reply to message #317808] Sat, 03 May 2008 18:14 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
How will you or anyone else know when your problem has been successfully resolved?

http://www.orafaq.com/forum/t/88153/0/
Please read & FOLLOW posting guidelines as stated above

Re: Group by having [message #317814 is a reply to message #317808] Sat, 03 May 2008 20:46 Go to previous message
Barbara Boehmer
Messages: 9077
Registered: November 2002
Location: California, USA
Senior Member
Are you using Oracle or a MySQL database? Please copy and paste what you get when you type this:

SQL> SELECT * FROM V$VERSION;

If you are using MySQL as the table structure of your other post seemed to indicate, then you are still in the wrong forum. This is an Oracle forum, not a MySQL forum. Any answers that you might receive here that would run on an Oracle database would most likely not run on a MySQL database. The two are completely different and only share minimal common SQL syntax.



Previous Topic: URGENT: Calculation query
Next Topic: Once again back with questions pls help
Goto Forum:
  


Current Time: Thu Mar 28 13:08:07 CDT 2024