What is the best way to add another case to pull specific warehouse from database?

  Kiến thức lập trình

i am trying to use the following statement to pull a specific bin from the database but I also want to add the specific warehouse to the case.

SELECT CASE WHEN EXISTS(SELECT binlabel
FROM binmstr with (nolock)
WHERE empty=’Y’) THEN (SELECT top 1 binlabel
FROM binmstr with (nolock)
WHERE empty=’Y’ and binlabel not like ‘#%’
order by binlabel) ELSE ‘NOMORE’ END as binlabel

New contributor

dbarrow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT