sql server - SQL - How can I use a Select based on the parameter -


i've got sql statement in sql server stored procedure using clause this:

select (fields) table testname @searchletter + '%' 

i need check parameter @searchletter , if it's "#", need make parameter choose records field testname starts numeric field (0-9)

i've tried several things (ifs/selects, etc.) can't seem need.

anyone know how can this?

try

where testname case @searchletter     when '#' '[0-9]' + '%'     else @searchletter + '%' end 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -