Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

262
Views
postgres select all rows that has any of list strings in a varchar[] column
create table Table1(id bigserial not null primary key, names VARCHAR(256)[]);

insert into Table1(names) values('{name1,name2}');

insert into Table1(names) values('{name3,name4}');

select * from Table1 where names @> '{name1}';

Result

id | name

---+-----

1  | {name1,name2}

I want to be able to provide list of varchar like name1, name3 and select query should return both rows

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can use the overlaps operator &&:

where names && array['name1', 'name3']::varchar[];
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!