Select and do not return values containing xxx

Asked

Viewed 1,199 times

3

I’m making the following select:

SELECT TABLE_NAME FROM USER_TABLES ORDER BY TABLE_NAME;

In this I have the name of the tables, the problem is that for each table I have a table_AUD, ex:

PESSOA
PESSOA_AUD
DOCUMENTO
DOCUMENTO_AUD

I wish you wouldn’t return the tables that have AUD, how can I do ?

  • Aren’t you confusing tables with columns? Do you want to select all columns of a table that do not contain _AUD right?

  • Tables even @Miguel

1 answer

6


You need to use the like to filter those that have AUD and adding the NOT we will only have those that do not end with AUD.

SELECT TABLE_NAME 
FROM USER_TABLES 
WHERE TABLE_NAME NOT LIKE '%_AUD'
ORDER BY TABLE_NAME;
  • Show, thank you very much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.