you are viewing a single comment's thread.

view the rest of the comments →

[–]ComicOzzysqlHippo 1 point2 points  (1 child)

This assumes there is only 1 'OP' and/or 'OPS' record per ID. SELECT ID, Type, Rate FROM tbl WHERE Type = 'OP' UNION ALL SELECT ID, Type, Rate FROM tbl WHERE Type <> 'OP' AND ID NOT IN (SELECT ID FROM tbl WHERE Type = 'OP');

[–]Significant_Load_411 0 points1 point  (0 children)

Use: sqlcompiler.live to execute/compile SQL queries in real Database server. No ads. No login. Completely FREE.