Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table and Coding Assistance
Message
From
18/03/2003 11:17:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
18/03/2003 11:12:22
N. Lea
Nic Cross Enterprises
Valencia, California, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00767082
Message ID:
00767089
Views:
9
>Hello! I have a small question regarding a SQL process. I am trying to get last record information from a table. This process uses two tables: 1 parent table and 1 child table. The data is going to a report.
>
>The parent tables hold five fields, one of which is an order number field
>
>The child table holds 50 fields, the two relevant fields are:
> 1. order number
> 2. order status
>
>The tables appears as:
>
>Parent                  Child
>Order number            Order Number     Order Status
>11111                   11111            Submitted
>11121                   11111            Processing
>11131                   11111            Shipped
>                        11121            Hold
>                        11131            Submitted
>                        11131            Processing
>                        11131            Cancelled
>
>
>Using a SQL, how would i go about getting the last possible order status?
>
>Select a.order_no, a.order_total, b.order_status, b. clerk;
>from parent a, child b ;
>where a.order_no=b.order_no;
>into cursor mysqlresults
>
>
>thanks in advance for any help!!

Select a.order_no, a.order_total, b.order_status, b. clerk ;
from parent a inner join child b ;
on a.order_no=b.order_no ;
group by a.orde_no ;
into cursor mysqlresults

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform