Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving complete row with MIN()
Message
 
 
À
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:
00503113
Vues:
16
Hi!

Correct. Thatnks for correction! I was thinking about main idea and simple cut&paste when reworking query drived me forget about that.

>>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
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform