Skip to content

Tag: sql

SQL for storing numbers from cold to hot for specific range?

We have a table that looks list this: date, val1, val2, val3, val4, val5 for a given row, val1 -val5 are unique and between 1 and 37 Using T-SQL, How can I list numbers 1 -37 by cold to hot with their frequency for a given date range? [![enter image description here][1]][1] Sample Output (NOT ACTUAL): Numbers…

Format Phone Numbers With Characters

I need to format the existing phone numbers saved in my database. First, I need to clean the phone numbers with character. 801-113-1521 801.456.7891 1213-345-6789 ext 219 (323)567=2251 should be: …