Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving complete row with MIN()
Message
De
03/05/2001 12:32:03
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00503015
Message ID:
00503112
Vues:
24
>Hi!
>
>
>SELECT pat_handle, last_name, first_name, gender,;
>       scantype, site, label, side, facility_i,;
>       Birth_time, Physician, Comments, Acq_time,;
>       BMD, Fracture_r, Percent_ya,;
>       Percent_am, Zsco_bmd_y, Zsco_bmd_a;
>  FROM working;
>  WHERE BMD IN ;
>    (SELECT MIN(BMD) FROM working;
>  WHERE scantype=19 AND (LABEL=4 OR LABEL=0) )
>
>
>HTH.
>
>Hi!
>

Vlad: I'm probably missing something here, but..........

Wouldn't this query select records where the BMD for ScanType = 18 is the same as the lowest BMD for ScanType = 19?

For Example:
Recno    Scantype    BMD
1            18       2
2            18       3
3            18       4
4            19       4
5            19       5
6            19       6
Records 3 and 4 would get selected

>
SELECT pat_handle, last_name, first_name, gender,;
       scantype, site, label, side, facility_i,;
       Birth_time, Physician, Comments, Acq_time,;
       BMD, Fracture_r, Percent_ya,;
       Percent_am, Zsco_bmd_y, Zsco_bmd_a;
  FROM working;
  <B>WHERE scantype=19 AND (LABEL=4 OR LABEL=0)
    AND</B> BMD IN ;
    (SELECT MIN(BMD) FROM working;
  WHERE scantype=19 AND (LABEL=4 OR LABEL=0) )
Have I missed something..........Rich
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform