SQL Language (MOSC)

MOSC Banner

Help with including column in a "where in" query

edited Nov 9, 2018 2:14AM in SQL Language (MOSC) 1 commentAnswered ✓

Hi,

I have this query that works fine, almost, I would like to include the NAME from ba.entry in the output

SELECT last_analyzed, num_rowsFROM dba_tablesWHERE table_name IN ( SELECT 'BA_' || id FROM ba.entry WHERE name IN ( 'datachange', 'downloadhandles', 'install', ...more tables )    );

So something like this:

SELECTlast_analyzed,num_rows,NAMEFROM ...

For some reason, they add BA_ infront of all the tables (in the BA schema), so entry table (which shows the connection between name and ID) looks like this:

100003 datachange

But in BAs schema datachange is refered as

BA_100003

Dont ask me why

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center