Search
 
SCRIPT & CODE EXAMPLE
 

SQL

check if string contains substring sql

Declare @mainString nvarchar(100)='Amit Kumar Yadav'  
---Check here @mainString contains Amit or not, if it contains then retrun greater than 0 then print Find otherwise Not Find  
if CHARINDEX('Amit',@mainString) > 0   
begin  
   select 'Find' As Result  
end  
else  
    select 'Not Find' As Result  
Comment

sql where contains part of string

-- To find an exact string
SELECT * FROM [table] WHERE [field] LIKE '%stringtosearchfor%'.
Comment

PREVIOUS NEXT
Code Example
Sql :: sql count 
Sql :: delete row psql 
Sql :: update query with between in mysql 
Sql :: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client vs code 
Sql :: alter table add multiple foreign key sql 
Sql :: pl/sql procedure example 
Sql :: how to make a select in sql 
Sql :: sql calculate working days between two dates excluding weekends and holidays 
Sql :: group_concat in mysql 
Sql :: mysql full outer join 
Sql :: how to combine first and last nae into one columb sql 
Sql :: mysql failed to login as root@localhost 
Sql :: joomla execute raw sql 
Sql :: postgresql connection string c# 
Sql :: oracle apex warning message 
Sql :: view databases in mysql 
Sql :: postgresql concatenate multiple rows into one row 
Sql :: get records in sql according to month name and count 
Sql :: postgres select duplicate columns 
Sql :: mysql kill 
Sql :: json extract 
Sql :: mssql dockere 
Sql :: postgresql remove new line from string 
Sql :: mysql remove first and last character from string 
Sql :: datetime postgres typeorm 
Sql :: select * where id = 1,2,3 
Sql :: how to change column name in mysql 
Sql :: create tablespace oracle multiple datafiles 
Sql :: set all auto_increment values in sql 
Sql :: query to find object dependencies in oracle 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =