Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong with this SQL Select
Message
De
08/02/2005 16:43:29
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00984918
Message ID:
00984922
Vues:
26
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform