Threen

joined 2 years ago
[โ€“] Threen@aussie.zone 2 points 2 years ago

Update: The original dev does not remember exactly. However they have said that clientId was originally a VARCHAR, so this may have been checking for both '0' or ''

So an over-engineered workaround to a bad datatype perhaps?

[โ€“] Threen@aussie.zone 0 points 2 years ago (1 children)

The client table has around 100,000 rows each with a unique clientId, none of which are returned from the CAST / ABS / SIN

I think you are right and this is a 'fix' for something lost to time. I am going to talk to the original dev tomorrow to see if they remember what it was for

1
Guess the intent (aussie.zone)
submitted 2 years ago* (last edited 2 years ago) by Threen@aussie.zone to c/sql@programming.dev
 

I am one of the developers on a very small team and have just found the following query

I would love to hear your ideas for what you think was being attempted here!

SELECT ... FROM client WHERE CAST(ABS(SIN(clientId)) AS BIT) = 0

 

I hope some people here enjoy reading these as much as I have

If you know of anything similar, I would love to hear them

 

I am a big fan of listening to Drone Zone on SomeFM while programming

Hit me with your favourite streams, albums or artists

 

Can probably only send you 1 gift, as my friend list is quite full

0692 0102 3964