Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong with this SQL Select
Message
 
 
À
08/02/2005 18:43:11
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:
00984981
Vues:
31
Your query will select all records for the DATE(). I need to select only the last transaction for each ROOM_NUM, within that date. That's why TOP 1 has to be somewhere. And as Sergey said, this is a limitation of subquery in VFP 8.


>Maybe I don't understand what you are trying to get with your query, but how about:
select RESER_PK, ROOM_NUM as ROOM, RES_DATE, BEGIN_TIME;
>   from RR_RESER;
>   where RES_DATE = DATE ();
>   order by ROOM
>
>>If I don't use TOP n clause I get too many records. The purpose of the subquery is to select just one record, at the top. And note that the subquery by itself works, and the main query by itself work too. Just when they are put together something is missing.
"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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform