|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
can someone please help me write a procedure
the procedure needs a fromal parameter shopper id and to sum the total column from THE BASKET TABLE.
THEN develope a select statment using the bbshoper table to produce a list of each shopper in the database ans his respective total ![]() |
|
#2
|
|||
|
|||
|
try some-in like:
CREATE OR REPLACE FUNCTION get_total_spent(p_shopper_id NUMBER) RETURN NUMBER IS total_spent NUMBER; BEGIN SELECT SUM(total_cost) INTO total_spent FROM basket WHERE shopper_id = p_shopper_id; RETURN total_spent; WHEN NO_DATA_FOUND THEN RETURN 0; END; / SELECT shopper_id, get_total_spent(shopper_id) from bbshopper; |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > can someone please help me write a procedure |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|