SQL Notes

Null values and their pitfalls

06/08/20204 min read

Learning: Best to not permit NULL values in columns which are used for comparisons If you compare a NULL value…

Passing comma separated String to function / stored procedure to use with IN condition

28/04/20201 min read

where column = any (string_to_array(replace(delimSources,’ ‘,”),’,’)) — replace(source,old, new) => removes whitespace — string_to_array(source,separator) => puts the string separated by…

Add leading zeroes to time

24/04/20201 min read

SELECT RIGHT(CONCAT(‘000000’,13000),6) When a time is saved as integer the leading zeroes will not be saved. (E.g. 1:30 am =>…

Leave a Comment

Your email address will not be published.