Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Subquery in a where clause

selezeusFeb 8 2019 — edited Feb 11 2019

Hello everybody, working with 11G.

For my SQL Gurus friends.

I need a subquery in a where clause, but, subqueries are something that I never use, so any help is welcome.

A normal select is this :

Select a, b, c, d, e from table1

where a = 25

I need this, but in this way

Select a, b, c, d, e from table1

where a = 25 or (select 1 from table2 where d = d)

this means where a = 25 orĀ  (in table2 exist a row with also another d column = to the d column in table1)

Any idea?

Thanks in advance and regards everybody.

This post has been answered by Frank Kulash on Feb 8 2019
Jump to Answer
Comments
Post Details
Added on Feb 8 2019
20 comments
6,455 views