PostgreSQL – 조건에 IN 활용

Where 구문에 같은 것 말고 리스트에 포함된 걸로 조사할 때 사용하는 IN 이 있다.

용례가 갑자기 생각이 안나서 찾아봄

PostgreSQL IN operator examples

https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-in/

Suppose you want to know the rental information of customer id 1 and 2, you can use the IN operator in the WHERE clause as follows:

`SELECT customer_id, rental_id, return_date `
`FROM rental `
`WHERE customer_id IN (1, 2) `
`ORDER BY return_date DESC;`
Share: Twitter Facebook
Bongjun Hur's Picture

About Bongjun Hur

BJ is a dev.

Seoul, Korea https://devbj.com