/* the following query will check “@” character in specified [FIELD_NAME].
* Suppose you want to remove all the character after @ from a field name.
* Suppose you have email addresses like rajan@rajanmaharjan.com.np, pasha@rajanmaharjan.com.np, john@rajanmaharjan.com.np
* Now you want to have all names and remove all character after @ than you can use following query to extract name to the field “name”
*/
update customer_detail set customer_name=
CASE
when (INSTR(email_address,”@”)>0)
THEN substring(email_address, 1, INSTR(email_address,”@”)-1)
ELSE “no name”
END
*/
update [TABLE_NAME] set [FIELD_NAME]=
CASE
when (INSTR([FIELD_NAME],”@”)>0)
THEN substring([FIELD_NAME], 1, INSTR([FIELD_NAME],”@”)-1)
ELSE [FIELD_NAME]
END