Skip to content
Advertisement

Tag: sql-server

Sum with latest date in SQL

Below is my SQL query Select [Item No_][Expiration Date],[Manufacturing Date] ,([Lot No_] ), Sum(Quantity)Quantity from [Warehouse Entry] Group by [Lot No_],[Expiration Date],[Manufacturing Date],[…

Cloning tree structure with guid

I am trying to clone tree structure to another table, but the problem is original table has guid as ParentId and Id and new table or table that I want to clone has int as ParentId and Id. I am trying …

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 by frequency descending:

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: …

Advertisement