I have table with 2 columns where in one of them an url is stored. Now I would need to update the table to remove all trailing slashes from the urls, including urls that have a query string. …
Asp.net multiple replace characters in insert statement?
I have a SQL insert statement in my asp.net webpage and I have to replace a testbox contents if a “:” exists with nothing”” like the following TextBox.Text.Replace(“:”, “”) Is there a way that I can …
issues with when/case statement
I have a code where i have this statement when d.ID in (1,2,3,4,5,6,7,8) then case when d.today < '01/01/2001' then …
Automating Repeated Unions
I’m running a query like this: SELECT id FROM table WHERE table.type IN (1, 2, 3) LIMIT 15 This returns a random sampling. I might have 7 items from class_1 and 3 items from class_2. I would like to …
Primary key with two references
I would like that my relation table “In” has a Foreign key SSN which references to two tables, but the SSN is only in one of these two tables. When I do this: ALTER TABLE “In” ADD CONSTRAINT in_C1 …
How can I join the same data for different columns?
I am sstruggling to make a query to join the corresponding replacing the IDs. I have two tables USERS and CONNECTIONS. Users: user_id first_name ——————– 3 Jim 4 Pam …
Azure SQL Password not meet complexity when coming from keyvault but not when coming from variable
I’m trying to create an Azure SQL Server in Azure with json ARM. In my json, when I put a password into a variable, the installation is ok. When I get the same password from a keyvault, it doesn’t …
Returning median values of time deltas across different groups
Trying to calculate the range between different steps in my data-table and return the median for each calculation using this SQL code: This returns the following error message: [0A000][500310] Amazon Invalid operation: within group ORDER BY clauses for aggregate functions must be the same; java.lang.RuntimeEx…
sql – select single ID for each group with the lowest value
Consider the following table: ID GroupId Rank 1 1 1 2 1 2 3 1 1 4 2 10 5 2 1 6 3 1 …
Sum rows with no field to group by
I’m using SQL server 2012 and I’m trying to sum rows of a table. Problem is I don’t have a column to group by. Is this possible…? How would you raise the query? Original table: +—-+——+——…