let's say I have a table with a lot of columns and I want to call same function on every of them (for example MAX). Is it possible without listing all ...
let's say I have a table with a lot of columns and I want to call same function on every of them (for example MAX). Is it possible without listing all ...
The following code is in SQL Server, I want to know how to refactor it so if EDA.GROUP_CARGO='' (If this field is empty, it means if it isn't A neithe ...
I have 3 TSQL queries that work individually, but I need to combine them into one single query. In Microsoft Access, they were successfully combined u ...
Ok, I have a query that will bring 1 or more records I know how to update but I need to insert the same PN and Keyvalue to a temp table so I can rever ...
I am selecting the name, size, growth, maxsize, and physical_name from sys.master_files and sys.database_files. I've noticed that when I do this the g ...
I have a table Products: For purchased two different things with a total value of 3000 or more, they give a third as a gift. I need a SQL query to ...
My column "ColumnOne" in my table "MyTable" has values like this: Delimiter is character '-' I want to update the values so eventually it look like ...
I am trying to convert this query to using dynamic columns (from another table). In this example I want to replace the 2 areas where I have type='comm ...
I'm building a report in Power BI and could setup a Power Query custom column using Text.Contains to solve this problem but the M Code would be very l ...
I found a common method to create XML from tables where elements' names changed into attributes' names. It looks like Is there a method to shorten ...
I've got a SQL table like below where one value is linked to a second value and vice versa. ROW ID1 ID2 ...
I have a table Customers which contains customerID and Country columns. I would like to return the country with the most customers and the count of th ...
Please help with SQL Server query. I need to ignore data when some values contain same value or no change in the values from dates a to dates b, and o ...
I am facing following challenge: I would like to flatten a parent child hierarchy in a way that I have per row the child + any parent of the upper lev ...
I am using SQL Server 2014 and I have the following Table (T1): I need to convert this table so that I get the output below: I tried the unpivot ...
I have data with an amount of 1 month and want to change it to 30 days. if 1 month the amount is 20000 then per day is 666.67 The following are sampl ...
I have a table of Card holders and the amount of each cards they have. I'm trying to query to get a result of Full Card Set holders and how many sets ...
I'm trying to select only the first result for each PlayerID. So I tried this query using DISTINCT : But it is still giving me all rows for each c ...
I'm trying to get this result but I'm not getting it. I've searched the forum but I can't find a solution to my problem. Can you help me and explain w ...
In my data set, each customer has some orders on different dates. For each customer each month, I want to check his/her last order in the previous mon ...