Ok so I have a table with three columns:
Id, Key, Value
I would like to delete all rows where Value
is empty (\'\'
Google send me here looking for a way filter all rows with an emoji on a varchar
column.
In case that your looking for something similar:
SELECT mycolumn
FROM mytable
WHERE REGEXP_EXTRACT(mycolumn,'\x{1f600}') <> ''
the \x{1f600}
is the char code for the searched emoji, you can find the emoji codes here
It's not an answer to your "why", but in terms of your overall goal, perhaps you should alter your strategy for searching for empty values:
Select * from [Imaging.ImageTag] where LEN([Value]) = 0
As per the comments (thanks Martin Smith for providing some copy/pastable emoji):
SELECT CASE WHEN N'' = N'
This is collation dependant.
Matches empty string
SELECT 1 where N'' = N'
Complementing this answers When you need use 'like' at sql
WHERE
N'' + COLUMNS like N'%'+ @WordSearch +'%' COLLATE latin1_general_100_ci_as