mercredi 15 juin 2016

SQL like clause difference between '%word-c%' and '%word-%'

I have the follwing query:

SELECT Url FROM Table n WHERE Url LIKE '%sipse.com/milenio/yucatan-%'

Which returns the following result set:

> http://sipse.com/milenio/yucatan-estados-
> http://sipse.com/milenio/yucatan-transpor
> http://sipse.com/milenio/yucatan-choferes 
> http://sipse.com/milenio/yucatan-congreso-pleno

But if I add a 'c' to the like parameter:

SELECT Url FROM Table n WHERE Url LIKE '%sipse.com/milenio/yucatan-c%'

The result set changes to only the next row:

> http://sipse.com/milenio/yucatan-congreso-pleno

Which is very strange to me because it should return:

> http://sipse.com/milenio/yucatan-choferes 
> http://sipse.com/milenio/yucatan-congreso-pleno

Does anyone have any idea about the reason of this behavior?

The collation of the Table is: Traditional_Spanish_CI_AS in SQL Server 2008

Aucun commentaire:

Enregistrer un commentaire