Search
 
SCRIPT & CODE EXAMPLE
 

SQL

case construct in where clause

where 
case when slogic = 'begins' and partnum like sPartStrp||'%' 
     then 1
     when slogic = 'contains' and partnum like '%'||spartStrp||'%'
     then 1
     when slogic = 'equals' and partnum = sPartStrp
     then 1
     when partnum like sPartStrp || '%' 
     then 1
     else 0
 end = 1
and p.stock_type = 1
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql check all tables 
Sql :: get comma separated values in mysql with group by 
Sql :: desinstaller mysql sur ubuntu definitivement 
Sql :: Postgres format number to 2 decimal places 
Sql :: alter in sql 
Sql :: execution order in sql 
Sql :: mysql error the maximum column size is 767 bytes. 
Sql :: oracle insert from select 
Sql :: MySql Subtract a table from another 
Sql :: SQL SUM() Function 
Sql :: how to login to mysql as normal user in ubuntu 
Sql :: oracle all columns 
Sql :: How to create a comulative Sum column in mysql 
Sql :: delete from table where length sql 
Sql :: longtext sql 
Sql :: FIND ABOVE AVERAGE SALARY EARNER IN SQL 
Sql :: what is subquery in sql 
Sql :: select all columns except one sql 
Sql :: inserted row count tsql 
Sql :: mysql set column equal to another automatic 
Sql :: sql select maximum column with other columns returned 
Sql :: drop table oracle 
Sql :: oracle tablespace autoextend 
Sql :: HAS VALUE CHECK IN SQL 
Sql :: t sql return on letters only 
Sql :: Join multiple table by MySQL 
Sql :: selecting all columns from table sql database 
Sql :: group by sql 
Sql :: sql server port 1434 
Sql :: postgres isnull 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =