Sql, get data/rows for more selected ids in one condition, from file

by genderbee   Last Updated August 14, 2019 12:06 PM

I am using PostgreSQL 11.5 on Ubuntu

Question

How can I get data/rows for more selected ids in one where condition? Ideally from file with list of ids.

Example

|product_id |product_name                                                                                        |product_url                                                                                         |filename                                                                                            |
|-----------|----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
|134810     |Vliesová tapeta bílostříbrný květ                                                                   |bydleni-tapety-vliesove-tapety-vliesova-tapeta-bilostribrny-kvet                                    |331322.jpg                                                                                          |
|134827     |Vliesová tapeta Grandeco Exposed PE-11-01-1                                                         |bydleni-tapety-vliesove-tapety-vliesova-tapeta-grandeco-exposed-pe-11-01-1                          |331325.jpg                                                                                          |
|134827     |Vliesová tapeta Grandeco Exposed PE-11-01-1                                                         |bydleni-tapety-vliesove-tapety-vliesova-tapeta-grandeco-exposed-pe-11-01-1                          |331325i.jpg                                                                                         |
|134807     |Vliesová tapeta béžová se stříbrnými pírky                                                          |bydleni-tapety-vliesove-tapety-vliesova-tapeta-bezova-se-stribrnymi-pirky                           |336628.jpg                                                                                          |
|134948     |Prskavky 90 cm 3 ks                                                                                 |zahrada-vanoce-vanocni-dekorace-prskavky-90-cm-3-ks                                                 |sp16-2.jpg                                                                                          |
|134943     |Krmítková směs 400 g                                                                                |zahrada-zimni-sortiment-krmitka-pro-ptactvo-krmivo-pro-ptactvo-krmitkova-smes-400-g                 |427298-krm-tov-sm-s-400g.jpg                                                                        |
|135074     |Sluban B0519 Fontánový kruháč se skútrem                                                            |zahrada-pro-deti-stavebnice-sluban-b0519-fontanovy-kruhac-se-skutrem                                |m38-b0519-1.jpg                                                                                     |
|145556     |Skříň LOGICO HIGH 65 x 45 x 182 cm                                                                  |bydleni-ulozne-boxy-a-kosiky-ulozne-skrine-skrin-logico-high-65x45x182-cm                           |343453-9634000-logico-high-cabinet-0270-preview.jpg                                                 |
|145556     |Skříň LOGICO HIGH 65 x 45 x 182 cm                                                                  |bydleni-ulozne-boxy-a-kosiky-ulozne-skrine-skrin-logico-high-65x45x182-cm                           |343453-9634000-logico-high-front-preview.jpg                                                        |
|135088     |Krbová kamna Verso                                                                                  |stavba-kamna-a-krby-krbova-kamna-a-biokrby-krbova-kamna-krbova-kamna-verso                          |verso-1.orez2.jpg

... and many more.

I need get data only for some ids/rows. Is there a way to insert file into where condition? Or must I use where ... and where ... and where condition for every id I need?

Tags : postgresql where


Related Questions


Postgres gist slow index f_unaccent

Updated April 09, 2018 20:06 PM