20
Apr

How to search for a column name in the Oracle Database

When you are working with Database systems, very often you will be stuck in a situation where you vaugely remember the column name but doesn’t know which TABLE the COLUMN belongs to. I’ve been in this situation more than a dozen times myself. I blame my bad memory for this.

Well, here is a small SQL query that does the trick for you.

SELECT TABLE_NAME,COLUMN_NAME FROM USER_TAB_COLUMNS WHERE COLUMN_NAME like '%customer_id%';

Replace the “customer_id” with the text that you would like to search for.

This works for a Oracle Database. I haven’t tried this with MySQL.

Please use the comment box for any suggestions.

Please bookmark this site.

No Comments

No comments yet.

Leave a comment

Search

Sponsored Links

Your Ad Here