Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

193
Vistas
How to use "NOT LIKE" for a column values in SQL

So I have a table like this:

X.        Y.
34560     eudhkri 34560 abc
26558     hsyrb 26558 ax
3666      dhurb 3666 yzhdj
3666      dhfhjf 366688 avh
233       abc 233 hdhsijej

Since characters in the Y column are changeable (meaning they have different number of letters) I thought I might use the NOT LIKE operator to exclude the rows where the X value is in the Y column.

However, I don't know how. It is not possible to just write it every values of X down. Also, I wrote the 4th row specifically to show you I can't exclude this data since the numbers are not same, so using % might cause some trouble.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You could use a regular expression:

WHERE y ~ ('\m' || x || '\M')

\m marks the beginning of a word, \M the end.

over 4 years ago · Santiago Trujillo Denunciar

0

if you want to use the like operatoe you could try this way

select *
from my_table 
where y NOT like concat('%',x,'%')

or

select *
from my_table 
where y NOT like concat('% ', x,' %')
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda