There is no such thing as a โseparate fieldโ. Your first syntax is parsed identically to the second: parentheses simply surround the field expression. You can also write:
SELECT DISTINCT (users.id), (2) AS someFieldName, (0) AS someOtherFieldName
All of them are equivalent.
If you want to avoid comparisons with your constant columns, you can use GROUP BY instead:
SELECT users.id, 2 AS someFieldName, 0 AS someOtherFieldName FROM users JOIN ... GROUP BY users.id
source share