Hacker News new | past | comments | ask | show | jobs | submit login

I once nearly lost a contest because of a faulty SQL query on their side. If I didn't get to see the query, I wouldn't have been able to defend my entry and would've lost. Losing this contest would've been trivial, but if I applied this to a trial, it would be horrible.

The error was that a 'group by' was used to find the number of unique entries, even though they had leading spaces, that were part of their uniqueness. Group by doesn't take leading spaces into account, leading them to get a different result than me. I think that this could've happened to a lot of people, even forensic IT engineers.




Actually it isn't specific to GROUP BY, the problem comes from the fact that some DMBS (MySQL for example) which ignore leading and trailing whitespaces (and other stuff like capitalization) while comparing strings, leading them to count less unique strings that a stricter comparision would count.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: