D
D
dfhkjhg2020-12-06 23:14:53
PostgreSQL
dfhkjhg, 2020-12-06 23:14:53

How to check for multiple id's in a table?

Let's say there is a table that stores data [id, price, name]

And before doing anything with this table, I need to make sure that the data I want to work with is in the table.

That is, I have an array [1,2,3,2] this is an array with the id of the items that they want to buy from me. Whether it is possible to check up as that one request if all these id in the table?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-12-06
@dfhkjhg

SELECT *
  FROM TABLE
 WHERE id IN (1,2,3);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question