|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
Oracle Confusion
Hi
I have a master table emp/dept and I need to display the data using a query that infuses the criteria of the scott database. I need to display the empno, ename of every salesman and the total number of products say 'Tennis Rackets' they have sold. How would I do this? Would it be a join or a subquery? Thanks Smiler |
|
#2
|
|||
|
|||
|
You dont need neither subquery nor join for this particular query.
SEECT empno, ename, count(*) FROM emp, sales WHERE empno = repid AND proid = 101860 GROUP by empno, ename / |
|
#3
|
|||
|
|||
|
Oracle Tables
Hi
The tables being used are: The normal emp/dept tables. The other tables are: Bonus(ename,job,sal,comm) Salgrade(grade,losal,hisal) Customer(custid,name,address,city,state,zip,area,phone,repid,creditlimit,comments) Ord(ordid,orderdate,commplan,custid,shipdate,total) Item(ordid,itemid,prodid,actualprice,qty,itemtot) Product(prodid,descrip) Price(prodid,stdprice,minprice,startdate,enddate) These are the tables I have...you mentioned sales for a couple of the queries, but there is no sales schema - what would it be instead of sales? Would it be repid/cust id? |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Oracle Confusion |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|