Bonjour, j'ai besoin d'un coup de pouce car je bloque.
Je dois utiliser une 'correlated subquery'.
Je dois créer une requête qui retournera tous les clients qui ont une limite de credit égal ou inférieur à la somme des commandes clients.
Actuellement, j'affiche tout :
select c.customer_id as id,
c.name,
c.credit_limit as limit,
sum(s.total) as spent
from customer c,
sales_order s
where c.customer_id = s.customer_id
group by c.customer_id, c.name, c.credit_limit;
ID NAME LIMIT SPENT
---------- --------------------------------------------- ---------- ----------
106 SHAPE UP 6000 9076.8
228 FITNESS FIRST 4000 7101
204 THE POWER FORWARD 12000 15071.4
208 AL AND BOB'S SPORTS 4000 21119.8
Ca affiche tout alors que je dois afficher que ceux qui ne dépasse pas leur limite de crédit avec 'correlated subquery'.
Je ne sais pas trop comment faire la suite.
Merci pour votre aide.