Happy Day.

You're trying talk about three records in a single query record, so you'll have to 
access the table three times:

SELECT DISTINCT T.ID, T.VALUE, P.VALUE, S.VALUE
FROM MY_TABLE T, MY_TABLE P, MY_TABLE S
WHERE T.ID = P.ID
AND T.ID = S.ID
AND T.CODE = 'T'
AND P.CODE = 'P'
AND S.CODE = 'S'

Cheers.
                        BJ...

----------
From:   Mark Derricutt[SMTP:[EMAIL PROTECTED]]
Reply To:       [EMAIL PROTECTED]
Sent:   Friday, 11 December, 1998 01:36
To:     Multiple recipients of list delphi
Subject:        [DUG]:  SQL Problem

[This message has also been posted.]
I have a table looking like this:

ID   | Code   | Value
-----+--------+-------
A    | T      | V1
A    | P      | V2
A    | S      | V3
B    | T      | V4
B    | P      | V5
B    | S      | V6

And I want to turn it into a table like:

ID   | Temp   | Pres   | Saturation
-----+--------+--------+------------
A    | V1     | V2     | V3 
B    | V4     | V5     | V6


Is it possible to do this via an SQL Query at all???

Mark
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to