SELECT
TOP 1 Field1,
Field2,
Field3
FROM
TableNameHere
will return the first record in the resultset. You can use the ORDER BY
clause to sort the resultset in the way that you want so that the first
record is what you want. You can substitute any number for the 1 (eg TOP 5
will select 5 records)
Use GROUP BY if you want to do this for each patient.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Daniel O'Dorisio" <daniel@o...>
Subject: [sql_language] Re: Sql script question
: hey.. ok i got it!!! thanks for all your help.. my scripts are below. one
: question.. and i know this must be simple, how would i take the listing
: table and get only one record for each patient.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~