Franki: Mysql Abfrage and & or

Beitrag lesen

Hallo,

wie gestalte ich meine abfrage so dass ich zwischen spalte 2 und 3 eine or verbindung bekomme und von spalte 2 und 3 zu 1 eine and verbindung, denn

SELECT * FROM xxx WHERE spalte1='suchwort' and spalte2 LIKE '%test%' or spalte3 LIKE '%test%'

durch das or bekomme ich jetzt alle beiträge wo in spalte3 '%test%' steht. Ich möchte aber das ich alles bekomme wo das 'suchwort' in spalte1 vorkommt und dann '%test%' entweder in spalte2 oder spalte3 vorkommt.

wie gestalte ich die abfrage?

Franki