SQL select from data in query where this data is not already in the database?

前端 未结 5 1230
日久生厌
日久生厌 2021-01-20 22:00

I want to check my database for records that I already have recorded before making a web service call.

Here is what I imagine the query to look like, I just can\'t

5条回答
  •  半阙折子戏
    2021-01-20 22:28

    I would probably just do:

    SELECT id
    FROM table
    WHERE id IN (1,2,3,4);
    

    And then process the list of results, removing any returned by the query from your list of "records to submit".

提交回复
热议问题