Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can this be done in one SQL Select?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00984864
Message ID:
00984944
Views:
37
Hi Venelina,

I tried your suggestion which I understand is replacing IN with "=" and using aliases for main query and subquery but I still get error.

Thank you for your suggestion.

>Hi Dmitry,
>
>A little changed Peter's suggestion.
>(not tested too, sorry)
>
>
select ot.KEYFIELD, ot.CUST_ID, ot.ORD_DATE, ot.ORD_TIME ;
>from ORDERTABLE ot;
>where KEYFIELD =
>	(select top 1 KEYFIELD from ORDERTABLE sot
>	where sot.CUST_ID == ot.CUST_ID
>	order by sot.ORD_DATE, sot.ORD_TIME descending where sot.ORD_DATE=yourDate)
>order by CUSTOMER
>
>Regards,
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform