tag:blogger.com,1999:blog-8712770457197348465.post5138973812558346419..comments2024-03-19T01:04:48.783-07:00Comments on Javarevisited: 10 SELECT Query Examples for Beginnersjavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-8712770457197348465.post-27144994172202164592014-12-22T03:18:12.601-08:002014-12-22T03:18:12.601-08:00@sachita, I am late to the party, but this may hel...@sachita, I am late to the party, but this may help others--><br /><br />SELECT deptNo, SUM(salary),sum(commission) from EMP GROUP BY deptNo HAVING sum(commission) IS NOT NULLvenkathttps://www.blogger.com/profile/13805742677196433793noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-79479909561442117962014-07-16T09:45:44.597-07:002014-07-16T09:45:44.597-07:00plz help me on this
EMP(eno,ename,hireDate,job,sa...plz help me on this <br />EMP(eno,ename,hireDate,job,salary,commission,deptNo)<br />display departno total salary and total commission for each department that pays at least one employee commission.<br />sachitanoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-83119512581168894882014-07-06T14:08:00.325-07:002014-07-06T14:08:00.325-07:00Select * from tableA where tableA.keyfield not in ...Select * from tableA where tableA.keyfield not in (select keyfield from tableB)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-66720987980627996132014-02-03T03:06:21.311-08:002014-02-03T03:06:21.311-08:00SELECT * FROM A
WHERE (field1, field2, ..., fieldN...SELECT * FROM A<br />WHERE (field1, field2, ..., fieldN) NOT IN<br />( SELECT *<br /> FROM B<br />) ;Amit Garghttps://www.blogger.com/profile/06739546572405882429noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-69163391227465836672013-01-03T20:51:55.616-08:002013-01-03T20:51:55.616-08:00Great list of examples for SQL SELECT clause, but ...Great list of examples for SQL SELECT clause, but you missed couple of them like How to use aggregate function with SELECT query e.g. I can find sum, average, min, max and count in select query without using group by clause :<br /><br />SELECT sum(salary) FROM employee will give you total salary paid, by the way NULL values will be ignored. Similarly<br /><br />SELECT avg(salary) FROM employee Yohananoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-70510456197246089692012-12-17T23:39:10.186-08:002012-12-17T23:39:10.186-08:00I frequently used SELECT clause to generate XML St...I frequently used SELECT clause to generate XML String from my stored procedure. Since SELECT query can print String as it is you can create a combination of static and dynamic String using SELECT command e.g.<br /><br />select '<name>' + p.name + '</name>' from Person p this will print<br /><name>James</name><br /><br />isn't it great example of SELECTJamesnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-17555259457920372932012-12-03T22:41:19.274-08:002012-12-03T22:41:19.274-08:00how to get data from a table & then compare th...how to get data from a table & then compare that one with other dataAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-81693991287826526972012-07-15T19:14:55.426-07:002012-07-15T19:14:55.426-07:00Ok Good Info..
I am rushing a job and doing direct...Ok Good Info..<br />I am rushing a job and doing direct selects on over 2800 rows and need to do various queries to review the db structure before making the the final update statements.<br /><br />Your tutorial is logical and gives clues as to how to build these queries and I appreciate the effort made here to help us in the dark hours.<br /><br />ThanksAnonymoushttps://www.blogger.com/profile/07574165259218809479noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-62202152392117876812012-01-11T06:46:12.250-08:002012-01-11T06:46:12.250-08:00what if i have 2 different tables and i want to se...what if i have 2 different tables and i want to see what values from table A are NOT in table B?Anonymousnoreply@blogger.com