P
P
panikev2020-05-27 10:39:16
PostgreSQL
panikev, 2020-05-27 10:39:16

How to form the correct postgres query?

Hello! Please help me to form the correct request. If I write like this:

select unnest(nomenclatures),company from nomenclatures_per_company where   'SW 105 050 30 052 SBDH 40 пластина твердосплавная'= ANY (nomenclatures);

then it returns all the positions of the
unnest array to me | company
------------------------------------------------ --+----------
SW 105 045 30 052 SBDH 40 carbide insert | Company Ltd.
SW 105 050 30 052 SBDH 40 carbide insert | Company OOO

But how can I make sure that there is only one position from the filter?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2020-05-27
@prity

LIMIT?

F
freeExec, 2020-05-27
@freeExec

SELECT DISTINCT ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question