Results 1 to 5 of 5

Thread: Oracle error message

  1. #1
    Join Date
    Mar 2004
    Posts
    84

    Oracle error message

    Hi,

    I have a query

    select a.col1, a.col2, b.col1,
    (select count(*) from table c) as count
    from table a, table b
    where a.col = b.col and
    count > 0

    that returns an error message "count: invalid identifier"

    What is wrong with this query and what is the work around?

    Thanks.

  2. #2
    Join Date
    Mar 2003
    Posts
    468
    i would assume that count is a reserved word. try chaning your column name.

  3. #3
    Join Date
    Mar 2004
    Posts
    84
    Changed the column name to test. Still getting the same error.

  4. #4
    Join Date
    Mar 2003
    Posts
    468
    ok. played around with it a bit and here
    it what i came up with:

    1. join condition a.col = b.col
    i am assuming you want to join :
    a.col1 = b.col1
    2. the order for count ... as count
    is invalid
    3. oracle doesn't seem to like a column
    rename in a column list, put in
    from clasue
    4. don't need "table a, table b" just
    name the tables in the from clause

    select a.col1, a.col2, b.col1
    from a, b,
    (select count(*) as count from c)
    where a.col1 = b.col1 and
    count > 0

  5. #5
    Join Date
    Mar 2004
    Posts
    84
    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
  •