Do select and do not return values that contain xxx

3

I'm doing 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, eg:

PESSOA
PESSOA_AUD
DOCUMENTO
DOCUMENTO_AUD

I would like you not to return the tables that have AUD, how can I do it?

    
asked by anonymous 11.04.2017 / 15:29

1 answer

6

You need to use like to filter those with AUD and adding 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;
    
11.04.2017 / 15:33