Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    2

    Question Unanswered: Help With a Odd Select Statment.

    Hey,

    i want to do somthing like this:

    Code:
    SELECT idx, amount FROM transactions WHERE idx=Max(idx);
    however we all know that i can't use an aggregate function in the where clause of a select statment. I was wondering if anybody could offer up a way to do what i posted above. I was thinking that it might be possible with some kind of join, but i am fairly new to sql and havn't really used joins yet. Thanks in advance for any help that people offer up.

    -Pizentios

  2. #2
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    query

    SELECT idx,amount FROM transactions WHERE idx=(SELECT max(idx) FROM transactions)
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  3. #3
    Join Date
    May 2004
    Posts
    2
    Thanks for the answer.

Posting Permissions

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