Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Order By, Group By!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00399010
Message ID:
00399070
Vues:
22
>I have copied the SQL below,
>
>SELECT Oimods.iid, Oimods.ioitemid, Oimods.imodid, Oimods.ipricegpid,;
> Order.order_no, Order.cticket, Oimods.ctktname, Oimods.iinvid,;
> Oimods.laddtobase, Oimods.nprice, Oimods.iqty, Oimods.cfraction,;
> Oimods.cmodified;
> FROM prism!oimods INNER JOIN prism!oitems;
> INNER JOIN prism!order ;
> ON Oitems.iorderid = Order.iid ;
> ON Oimods.ioitemid = Oitems.iid;
> WHERE Order.order_no = ?vp_order_no;
> ORDER BY Oimods.ioitemid, Oimods.imodid
>

John,
So when you look at the result from the view, how is it ordered? It looks like you want to order by line item ID (Oimods.ioitemid {integer order item ID}) and then modification ID (Oimods.imodid {integer mod ID}).

If imodID is the primary key of the modification table then it looks like it would order things sequentially. PKs are generated as the record is inputed. If there is a PK generattin algorithm, it probably takes takes the preceeding key, increments it and returns the new value. So anything in PK order would be in sequential order. What order do you want it in: alphabetic by mod name (e.g. Pep, Mushroom or do you have a sequence order to display modifications (e.g. Pep goes before sausage because the ingedients are in that order).
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform