select items, and max id

From: "Luis H(dot)" <pgsql-novice(at)geekhouse(dot)no-ip(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: select items, and max id
Date: 2003-08-29 02:11:49
Message-ID: 001401c36dd2$e8097700$0301a8c0@bigbertha
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have a table where each row has an id unique identifier (separate from the one postgreql does automatically). I want to be able to do a certain SELECT query returning various rows, and also be able to check what the maximum id was among the rows in the result. Is it possible to do this all in the same query? Right now I do it in a very dumb way -- I execute the query to get all the data, and then I re-execute it as a subquery and pull out the max(id).

Thanks.

In response to

  • Force Lock at 2003-08-28 20:17:34 from Girish Bajaj

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Browne, George (AT-Atlanta) 2003-08-29 02:27:16 How does it work
Previous Message Girish Bajaj 2003-08-28 20:17:34 Force Lock