Results 1 to 1 of 1
  1. #1
    Join Date
    Feb 2004
    Location
    Russia / SPb
    Posts
    1

    Unanswered: several nested subselects

    Hi all,

    I have to select two columns of data, stored in one table witch records divided by offset.

    SELECT (SELECT time14 FROM eq_archiv WHERE objectid=57 AND recordtype=rtype('eq_archiv','NOW')) AS so, (SELECT time14 FROM eq_archiv WHERE objectid=1081 AND recordtype=rtype('eq_archiv','NOW')) AS po

    works well, but now I need to select several rows witch these two columns. I'm using:

    SELECT eq_archiv.objectid, (SELECT time9 FROM eq_archiv WHERE objectid IN (250,251) AND recordtype=rtype('eq_archiv','NOW')) AS so, (SELECT time9 FROM eq_archiv WHERE objectid IN (1274,1275) AND recordtype=rtype('eq_archiv','NOW')) AS po

    but that doesn’t works - PG try's to select several objects, but couldn’t combine them...

    dose anybody know about how to do this?

    Thanks, Dm.
    Last edited by Dm.; 02-06-04 at 06:53.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •