P
P
Pavel Bogdanov2016-02-02 09:04:29
Oracle
Pavel Bogdanov, 2016-02-02 09:04:29

How to use the result of a query in a condition?

Good afternoon!
There is such request: select user from dual ;
in it I get the name of the current user. How can the result of this query be used for a subsequent query on the table? Those. for example, display all records from a table where the username matches the name in the table. The request to the table will be processed by means of RLS.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kovalsky, 2016-02-02
@rebirther23

What's stopping you from doing so?

SELECT something FROM someTable as st 
INNER JOIN dual as d ON d.user = st.user AND d.user = 'someName'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question