tags:

views:

32

answers:

3

I'm trying to SELECT fields with multiple dots ( . ) in their value.

Exactly, I'm trying to find fields with a subdomain as an entry in domain column, e.g.;

SELECT * FROM domains WHERE ( number of dots in domain value bigger than 1 ).

Any suggestions ?

A: 

You can use regular expressions:

SELECT * FROM domains WHERE domain REGEXP '\\.+'

Assuming you want the dots placed near each other: ...

True Soft
A: 

The string functions don't seem to have anything in that vein, so you may need the REGEXP operator.

Pekka
+1  A: 

You could use

SELECT * FROM domains WHERE ( domain LIKE "%.%.%" ). 

See the MySQL Documentation for String functions for details.

Jens
lolz, time to get my coffee, I totally forgot that '%' is a wildcard :D
Kemo