Requête SQL

Résolu
Bonsoir ,

J'ai trois tables :

Article (Ref, designation, prix, type )
Stock ( id_stock, Stock_actuel, date, #ref)
PC(id_donnée, stock_sécurité, stock_max, point_cmd, annee, #ref)

Je veux afficher les articles qui ont un stock_actuel inférieur au point_cmd.

comment puis-je afficher cette requête? Merci d'avance

4 réponses

  1. salut, essaye :

    SELECT DISTINCT Stock.Stock_actuel FROM Stock, PC WHERE Stock.Stock_actuel < PC.point_cmd ORDER BY Stock.Stock_actuel ASC LIMIT 0,20
    


    j'ai pas testé...dis nous :)
    ׺°"~'"°º×]|I{*------» LÖBÖTÖ «------*}I|[׺°"~'"°º×
    1. ça n'a pas marché, la requête m'affiche le stock actuel
    2. Mais Merci beaucoup pour votre aide
    3. salut, j'avais mal lu l'énoncé attends
  2. Select articles from tatable where stock_actuel<point_cmd

    1. essaye ca...

      SELECT DISTINCT Article.designation FROM Article, Stock, PC WHERE Stock.Stock_actuel < PC.point_cmd AND Article.Ref = Stock.ref LIMIT 0,20
      

      1. j'ai trouvé la requête, en fait un ami à moi l'a trouvé :) !!

        select s.ref, pc.ref, s.stock_actuel, pc.point_cmd, annee from stock s, pc where s.ref=pc.ref and s.stock_actuel < pc.point_cmd

        Merci beaucoup pour votre temps :)