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. …
Tag: sql-server
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: +—-+——+——…
SQL – join three table with “where” clause
I want to write an SP that I will use in my c# program. I have three tables: Table1 (id pk, name, …), Table2 (id PK, name, …) and Table3((idT1,idT2) PK FK). So, Table3 models the n:n relationship …
SQL Server – Use substring in where clause
I’m trying to come up with a query in which it’s going to filter based on a substring. The substring operation is working fine if I use it as a select statement, but not when I try to use it for …
Is it possible to select a distinct column and get another column’s value count? [closed]
I think I might know enough to do parts individually but is it possible to do it with one statement? I need to display a model count for each year it appears in. I have the following data: id model …
What is the simplest way to put pass an array of values into a parameter of TVF
Objective: I would like to have a parameter in my function to allow the user to input a list of values. Ideally, the simplest solution … Note: I dont have permissions to create tables in dbs. …
How to insert new rows based on values in other columns in sql server?
I have a dataset like below: Id A14_Comment A15_Comment A16_Comment 1 Comment1 null null 2 Comment2 Comment3 Comment4 3 null Comment5 …
How to Create SELECT for Total sales for each region
I want to write a query to get Total sales for every region, but i cant figure the way to do it. I have these tables: Region(RegionID, Name) Client(ClientID, Name, City, Country, Email, RegionID) …
SELECT from 50 columns
I have a table that has many columns around 50 columns that have datetime data that represent steps user takes when he/she do a procedure SELECT UserID, Intro_Req_DateTime, Intro_Onset_DateTime, …