Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is wrong with this SQL Select
Message
From
08/02/2005 16:43:29
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00984918
Message ID:
00984922
Views:
27
The TOP n clause work only with the GROUP BY clause. Since Reser_PK should be unique because it is the PK, you don't need the TOP n and ORDER BY clauses:
select RESER_PK, ROOM_NUM as ROOM, RES_DATE, BEGIN_TIME ;
from RR_RESER ;
where RESER_PK in ;
(select RESER_PK from RR_RESER where ROOM_NUM == ROOM ;
AND RES_DATE = DATE()) order by ROOM
HTH

>What could be wrong with the following query:
>select RESER_PK, ROOM_NUM as ROOM, RES_DATE, BEGIN_TIME ;
>from RR_RESER ;
>where RESER_PK in ;
>(select top 1 RESER_PK from RR_RESER where ROOM_NUM == ROOM ;
>AND RES_DATE = DATE() order by BEGIN_TIME descending)  order by ROOM
>
>The error I get is:
>Command is missing required clause
>The RESER_PK is a PK field.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform