New answers tagged

0

You could concatenate the columns and use "like": SELECT school_name FROM schools WHERE Subject1||Subject2||Subject3 like '%Physics%'


-1

You could create a UNIQUE index on (username).


1

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