|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Update Query
Hi
I have a query to update the commission of salesmen by 1.5% of the income from all the sales they have been associated with. The query was: UPDATE emp X SET comm = (SELECT SUM(NVL(comm,0))*1.59 FROM emp Y WHERE Y.empno = X.empno GROUP BY Y.empno This isnt working, would this work: UPDATE emp e SET comm = (SELECT SUM(NVL(comm,0))*1.59 FROM emp e WHERE e.empno = e.empno GROUP BY e.empno Would the latter work - can anyone advise me on this? |
|
#2
|
|||
|
|||
|
Use following query
Hi,
Try this query: UPDATE emp e SET comm = (SELECT SUM(NVL(comm,0))*1.59 where job='salesman' Regards, Jigar |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Update Query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|