Hi, let me say that you are using a strange (to me) logic.
However, I can suggest to use an CASE..WHEN (http://ift.tt/1yYchHu):
SELECT
firstname,
coursetitle,
CASE
WHEN coursecompleted=1 THEN 1
ELSE NULL
END AS pass,
CASE
WHEN coursecompleted=0 THEN 1
ELSE NULL
END AS fail
FROM test
No comments:
Post a Comment