New answers tagged php
You could concatenate the columns and use "like": SELECT school_name FROM schools WHERE Subject1||Subject2||Subject3 like '%Physics%'
You could create a UNIQUE index on (username).
Looks like a list of match results and you want to get won/lost points: SELECT team, SUM(pointa), SUM(pointb) FROM ( -- use all rows twice with switched points SELECT teama AS team, pointa, pointb FROM tab UNION ALL SELECT teamb, pointb, pointa FROM tab ) AS dt GROUP BY team
Top 50 recent answers are included