Hi All,
I have a small query realted to selecting values from a table.
create table employee (eid number, ename varchar2(20));
insert into employee values (1,'Nik');
insert into employee values (2,'Prashant');
commit;
Now I have a small list say A, b, C , i want to select this list along with all rows like
with test1 as(
select eid, ename from employee
)
select eid,ename, 'A' col1 from test1
UNION ALL
select eid,ename, 'B' col1 from test1
UNION ALL
select eid,ename, 'C' col1 from test1
but the issue with this is that in production my employee table has millions of records and this scans the employee table thrice (or the number of constant values)
Is ther any other way to acheive this.
Thanks,
Nik