Hello Guys,
How I can to make my query to receive a parameter using '%like%'?
I tried this 3 options below but its dont working ( last(5ยช) line )
SELECT PSR.NOME, CO.NOME, FU.NOME, CO.ATIVO,CO.ID_PSR
FROM COLABORADOR CO
LEFT OUTER JOIN PSR ON PSR.ID_PSR = CO.ID_PSR
LEFT OUTER JOIN FUNCAO FU ON FU.ID_FUNCAO = CO.ID_FUNCAO
WHERE PSR.NOME LIKE %@Nome_PSR%
SELECT PSR.NOME, CO.NOME, FU.NOME, CO.ATIVO,CO.ID_PSR
FROM COLABORADOR CO
LEFT OUTER JOIN PSR ON PSR.ID_PSR = CO.ID_PSR
LEFT OUTER JOIN FUNCAO FU ON FU.ID_FUNCAO = CO.ID_FUNCAO
WHERE PSR.NOME LIKE '%@Nome_PSR%'
SELECT PSR.NOME, CO.NOME, FU.NOME, CO.ATIVO,CO.ID_PSR
FROM COLABORADOR CO
LEFT OUTER JOIN PSR ON PSR.ID_PSR = CO.ID_PSR
LEFT OUTER JOIN FUNCAO FU ON FU.ID_FUNCAO = CO.ID_FUNCAO
WHERE PSR.NOME LIKE @Nome_PSR
Follow in attachment
How I can to make my query to receive a parameter using '%like%'?
I tried this 3 options below but its dont working ( last(5ยช) line )
SELECT PSR.NOME, CO.NOME, FU.NOME, CO.ATIVO,CO.ID_PSR
FROM COLABORADOR CO
LEFT OUTER JOIN PSR ON PSR.ID_PSR = CO.ID_PSR
LEFT OUTER JOIN FUNCAO FU ON FU.ID_FUNCAO = CO.ID_FUNCAO
WHERE PSR.NOME LIKE %@Nome_PSR%
SELECT PSR.NOME, CO.NOME, FU.NOME, CO.ATIVO,CO.ID_PSR
FROM COLABORADOR CO
LEFT OUTER JOIN PSR ON PSR.ID_PSR = CO.ID_PSR
LEFT OUTER JOIN FUNCAO FU ON FU.ID_FUNCAO = CO.ID_FUNCAO
WHERE PSR.NOME LIKE '%@Nome_PSR%'
SELECT PSR.NOME, CO.NOME, FU.NOME, CO.ATIVO,CO.ID_PSR
FROM COLABORADOR CO
LEFT OUTER JOIN PSR ON PSR.ID_PSR = CO.ID_PSR
LEFT OUTER JOIN FUNCAO FU ON FU.ID_FUNCAO = CO.ID_FUNCAO
WHERE PSR.NOME LIKE @Nome_PSR
Follow in attachment