Checking whether an item does not exist in another table

前端 未结 4 1330
失恋的感觉
失恋的感觉 2020-12-15 16:07

My tables are set up something like this:

table name: process
fields: name, id_string

table name: value_seach
fields: id_string, value

I w

4条回答
  •  生来不讨喜
    2020-12-15 17:04

    I believe using Not Exists would be your best option here.

    SELECT p.name, p.id_string
    FROM process p
    WHERE 
       NOT p.id_string IS NULL AND
       NOT EXISTS(
              SELECT NULL
              FROM value_search v
              WHERE p.id_string = v.id_string)
    

提交回复
热议问题