Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Untested, but this is the general approach:

  SELECT unnest(ar).* FROM
    (SELECT ARRAY(SELECT tbl FROM tbl
                  WHERE .. ORDER BY .. LIMIT 2) AS ar
     FROM .. OFFSET 0) ss;
If you want a specific set of columns instead of *, you'd need to create a custom composite type to create an array of, since it's not possible to "unpack" anonymous records.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: