Results 1 to 3 of 3

Thread: group by query

  1. #1
    Join Date
    Jul 2003
    Posts
    21

    Unanswered: group by query

    Hi I'm trying to execute the following query:

    select screen_name, amount from acnt_plyr plyr,
    (select sum(amount) as amount, time_stamp from acnt_tran
    where type in (8,10) and time_stamp < to_date('2003-06-20 23:59:59', 'YYYY-MM-DD HH24:MIS')
    and time_stamp > to_date('2003-05-20 00:00:00', 'YYYY-MM-DD HH24:MIS')
    group by time_stamp order by amount desc) t1,
    acnt_acnt acnt
    where t1.acnt_id = acnt.id and plyr.id = acnt.plyr_id and acnt.IS_REAL=1
    and screen_name in ('Z350')

    but it complains on the 2nd last line that it doesn't know what t1 is (Invalid identifier)

    Anyone have any ideas? thanks
    Last edited by mojojo82; 07-08-03 at 21:12.

  2. #2
    Join Date
    Jun 2003
    Location
    Sydney, Australia
    Posts
    66

    Re: group by query

    the subquery should return a column named "acnt_id" in its Select list. The Invalid Identifier error does not refer to T1. It refers to "acnt_id", and I can see that it is indeed missing.

  3. #3
    Join Date
    Jul 2003
    Posts
    21
    thanks a lot !!!

Posting Permissions

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