Home > Blockchain >  SQL exclude query
SQL exclude query

Time:11-20

Can anyone help me with this query?

select name as d, test_run_id as r, folder_id as f From test_run;

This query yields me the values I would like to exclude from the top query:

 select folder_id from folder where name in (select column_value from table (apex_string.split(config.get('ATM_DASHBOARD_CONFIGURATION_FOLDER_EXCLUDE'), ','))); 

Can anyone help me combine them? I need to exclude results from the second query in the first one.

This was one of my many tries:

select name as d, test_run_id as r, folder_id as f From test_run 
EXCEPT
(select folder_id as f  from folder where name in (select column_value from table  (apex_string.split(config.get('ATM_DASHBOARD_CONFIGURATION_FOLDER_EXCLUDE'), ','))));

Many thanks

CodePudding user response:

Have you tried, something like:

SELECT name as d, test_run_id as r, folder_id as f
FROM test_run 
WHERE f not in(select folder_id as f from folder where name in (select column_value from table  (apex_string.split(config.get('ATM_DASHBOARD_CONFIGURATION_FOLDER_EXCLUDE'), ','))));

CodePudding user response:

try using where not exists

  select * from table_a a
   where not exists
       ( select '' from table_b b where b.name=a.name 
  • Related