This topic is locked

Search for first and last record

3/6/2009 8:40:48 PM
ASPRunnerPro General questions
K
kinho author

Hi All,
How can I search for the first and lastrecords only in the SQL search?
Sample data:

+------+-------+--------+----------+--------------+-----------+

| un | un_id | enc_no | env_code | env_codename | edssscore |

+------+-------+--------+----------+--------------+-----------+

| 1Y | 1 | 6 | WBAV7 | KURTZKE DSS | 6 |

| 1Y | 1 | 8 | WBAV7 | KURTZKE DSS | 8 |

| 1Y | 1 | 10 | WBAV7 | KURTZKE DSS | 8 |

| 1Y | 1 | 11 | WBAV7 | KURTZKE DSS | 7 |

| 1Y | 1 | 12 | WBAV7 | KURTZKE DSS | 8 |

+------+-------+--------+----------+--------------+-----------+
I am trying to get the scores from the first and last record, so I can calculate the

difference in values over time (date field comes from a second table).
I tried the GROUP BY and it didn't really return the right set of records.
Any help or direction to look will be much appreciated.
Kin