Consider the following queries
INSERT INTO DummyTable (TextColumn) VALUES ('Text');
INSERT INTO DummyTable (TextColumn) VALUES ('Text ');
SELECT DISTINCT TextColumn FROM DummyTable
Notice that the second insert contains a whitespace: 'Text '
But DISTINCT ignores the space and returns only one row 'Text' - how do you make DISTINCT not to ignore the whitespace?
Turns out I was looking for a BINARY keyword, the DISTINCT then compares raw binary values, including spaces.
SELECT DISTINCT BINARY TextColumn FROM DummyTable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With