yes, I tired but it won't work because this view can not have the hard coded WHERE clause as this will be passed by user. Based on your syntax view should be like code below but this is not working for my requirement. The left outer join part is returing result from whole table while first sel is returning correct result. Both sides of join are not matching in the view sql like the way they do in query.
yes, I tired but it won't work because this view can not have the hard coded WHERE clause as this will be passed by user. Based on your syntax view should be like code below but this is not working for my requirement. The left outer join part is returing result from whole table while first sel is returning correct result. Both sides of join are not matching in the view sql like the way they do in query.
Create
view
VW2
as
SEL a.col1,
a.col2,
a.col3,
b.col4
from
( sel col1,
col2,
col3
from
tab1
) a
left
outer
join
(SEL col1,
Col3
as
col4
from
tab1
qualify row_number() over (
order
by
col1) = 1
) b
on
a.col1 = b.col1;