Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Left join
Message
De
26/06/2002 07:39:42
 
 
À
26/06/2002 06:58:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00672381
Message ID:
00672387
Vues:
8
>Hello ,
>I would like to have a cursor as result with for each minute of the day a registration value if there is no registration for that period then I will change to .null. value to 0.
>
>ltend=datetime()
>ltstart=ltend-7200
>*the seconds are changed to zero.
>
>CREATE CURSOR curDates (dDatetime T)
>do while ltstart<=ltend
> INSERT INTO curdates (dDateTime) VALUES (ltstart)
> ltstart=ltstart+60
>enddo
>
>SELECT * FROM registrations right JOIN curdates ON Registrations.datetime=curdates.dDatetime ;
> ORDER BY curdates.dDateTime into cursor ctest
>
>With this SQL-command I don't get a result the value-field is empty for all the dDatetime-records ??

I have tested with the NOT-clausule.
I would like to make a list of dates that are not included in the table registrations.

select curdates.dDatetime from curdates ;
WHERE curdates.dDatetime NOT IN (SELECT DISTINCT Datetime as dDatetime FROM registrations where ovenid==0)



If I run the first SQL-part 'select curdates.dDatetime from curdates', I have 241 results.
If I run the last SQL-part 'SELECT DISTINCT Datetime as dDatetime FROM registrations where ovenid==0' I have 16 results.

Normally I should get 241-16 records If I run the whole Sql-command 'select curdates.dDatetime from curdates ;
WHERE curdates.dDatetime NOT IN (SELECT DISTINCT Datetime as dDatetime FROM registrations where ovenid==0)' but I still get 241 results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform