I'm running a select distinct query to pull only unique data tied to a client. For some of the data, I'm pulling, it is stored with leading zeroes, and for others it isn't. Is there a way to build in functionality to remove the leading zeroes when running the select distinct? I'm currently seeing what are essentially duplicates because the leading zeroes aren't causing the distinct to do it's job correctly.
My query is:
SELECT DISTINCT society, work_no
FROM data1
WHERE songcode = '5645'
and my results are showing:
Society Work_No
A 0123
A 123
B 567