Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    35

    Unanswered: help in this SQL

    Hi, I am getting ORA-00904 error "A": invalid identifer.

    Here's the SQL that I am running..

    select ((a-b)/a) * 100, (select count(user_id) as a from up_user where date_created between '01-JAN-2004' and '31-JAN-2004'), (select count(user_id) as b from up_user where date_created between '01-DEC-2003' and '31-JAN-2003') from up_user;

    Any ideas why?

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: help in this SQL

    Incorrect syntax (a and b must be columns fromr tables/views in the FROM clause). Try:
    PHP Code:
    select ((a-b)/a) * 100
    from
    select (select count(user_idfrom up_user where date_created between '01-JAN-2004' and '31-JAN-2004') as a,
             (
    select count(user_idfrom up_user where date_created between '01-DEC-2003' and '31-JAN-2003') as b
      from dual
    ); 
    BTW, there is something wrong with your "b" date range!

Posting Permissions

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