Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order By, Group By!
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00399010
Message ID:
00399070
Views:
25
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform