Reputation: 585
In Oracle DB, how to list all tables that exist in a schema with the table names having a substring like Student? Say you have a list of tables like College_student, Student_Offer or Student_Dept etc..
Upvotes: 2
Views: 7135
Reputation: 22427
SELECT table_name
FROM all_tables
WHERE owner = :owner
AND upper(table_name) LIKE '%STUDENT%';
we upper the name first in the predicate because some people insist on case sensitive object names in Oracle.
I run this with STU vs STUDENT in the LIKE search and see these results -
And since you tagged SQL Developer - you can simply browse a schema using the connection tree and optionally add a filter on the name.
Upvotes: 3
Reputation: 521028
You may query the all_tables
table:
SELECT table_name
FROM all_tables
WHERE table_name LIKE '%student%';
Upvotes: 4