Select rows which are not present in other table

后端 未结 4 2218
抹茶落季
抹茶落季 2020-11-21 07:47

I\'ve got two postgresql tables:

table name     column names
-----------    ------------------------
login_log             


        
4条回答
  •  广开言路
    2020-11-21 08:09

    SELECT * FROM testcases1 t WHERE NOT EXISTS ( SELECT 1
    FROM executions1 i WHERE t.tc_id = i.tc_id and t.pro_id=i.pro_id and pro_id=7 and version_id=5 ) and pro_id=7 ;

    Here testcases1 table contains all datas and executions1 table contains some data among testcases1 table. I am retrieving only the datas which are not present in exections1 table. ( and even I am giving some conditions inside that you can also give.) specify condition which should not be there in retrieving data should be inside brackets.

提交回复
热议问题