Question

I am having problem with my query...

This one works:

  select name, bday, address, dbms_random.value(1, 100) as joker
    from employee 
order by joker asc

But when I try to get what I want using either the 'where' and group/having clause, I am getting a ora-00904 (invalid identifier) ERROR..

e.g.

  select name, bday, address, dbms_random.value(1, 100) as joker 
    from employee 
   where joker>5 
order by joker asc

  select name, bday, address, dbms_random.value(1, 100) as joker
    from employee 
group by name, bday, address 
  having joker > 5 
order by joker asc 

What could be my problem here and how can i query using the joker column?

Was it helpful?

Solution

try:

Select * from
(select name, bday, address, dbms_random.value(1, 100) as joker 
from employee)
where joker>5 
order by joker asc
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top