tags:

views:

29

answers:

2

Hello, How can I search within a MySQL table for results ending in anything except ".jpg"? Thanks.

A: 
SELECT  *
FROM    mytable
WHERE   myfield NOT RLIKE '\\.jpg$'
Quassnoi
+5  A: 

You don't need to involve regular expressions, you can just do:

SELECT my_fields
FROM my_table
WHERE my_field NOT LIKE '%.jpg'
Greg