I have 2 columns in a table where column A has distinct records and column b does not i.e. column b could have multiple items of the same value in each row.
What I require is to only show distinct records based on column B. I do need both columns though as it will be an input in Crystal Reports but I don't care what value column A has.
CreatedBy column has multiple different values and I need to get those distinct values.
Query
SELECT DISTINCT nh.InNeoHistoryId, nh.CreatedBy
FROM NeoHistory nh
GROUP BY nh.CreatedBy, nh.InNeoHistoryId
Result