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

  • cekehechu

    cekehechu

    20 HAZİRAN 2006
  • Michael Lummio

    Michael Lumm

    25 Mayıs 2007
  • Watcher3223

    Watcher3223

    15 Kasım 2007