SORU
13 Kasım 2010, CUMARTESİ


Mysql birden çok değer Gibi

Merhaba, bu mysql sorgu var

Bu içeriği ile veritabanı alanları var

sports,shopping,pool,pc,games 
shopping,pool,pc,games 
sports,pub,swimming, pool, pc, games   

Neden böyle sorgu çalışmıyor mu? Ya spor ya da bara ya da her ikisi ile alanları ihtiyacım var?

SELECT * FROM table WHERE interests LIKE ('%sports%', '%pub%')

TY

CEVAP
27 EYLÜL 2011, Salı


Bu daha hızlı yapmanın bir yolu:

WHERE interests LIKE '%sports%' OR interests LIKE '%pub%'

bu:

WHERE interests REGEXP 'sports|pub'

Burada bu çözüm bulundu: http://forums.mysql.com/read.php?10,392332,392950#msg-392950

Hakkında daha fazla bilgi burada REGEXP: http://www.tutorialspoint.com/mysql/mysql-regexps.htm

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Ayite Atiwoto (superjiffrey)

    Ayite Atiwot

    29 EYLÜL 2010
  • Joshua Kywn

    Joshua Kywn

    17 Mayıs 2010
  • ModNation Racers H.Q.

    ModNation Ra

    31 Ocak 2010