Skip to content

Tag: tsql

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…

Query SQL with similar values

I have to make a query to a base using as a comparison a string like this 12345678, but the value to compare is this way12.345.678, if I do the following query it does not return anything. SELECT * …

Getting the personal contact details of an employee

I want to get the Email, Phone and Mobile number of each employee. The ContactDetailsType contains the Label which is email,phone,fax… and ContactDetails contains the ContactDetailsTypeId (the ID of ContactDetailsType) and the Info having the value of the phone number (for example). I tried the followin…