About 15,000 results
Open links in new tab
  1. CTE Tutorial - social.msdn.microsoft.com

    Oct 7, 2021 · Common Table Expression (CTE) is a temporary named result set that you can reference within a SELECT, INSERT, UPDATE, or DELETE statement. check for your answer.

  2. Using the in () parameter in a cte query - social.msdn.microsoft.com

    Nov 4, 2011 · I am passing a string back from reporting services into a function in SQL 2005. If a single selection is passed back it works but a multiple select fails to return a result. If I manually type the …

  3. sql query to compare the last two records - social.msdn.microsoft.com

    Dec 1, 2010 · After defining the CTE, I'm using it to compare the records as required. This uses a select statement against the CTE name data. The latest value is determined using the max (case rn when 1 …

  4. using a CTE then getting results into a temp table

    Feb 19, 2016 · well i need to get the results into a temp table. The reason being that i need to show the top 10 per group of the results. And i can't do this straight from the results. Or thats what i've …

  5. Get Distinct rows based on only one column

    Oct 7, 2021 · How to get distinct rows based on only one column ??? I have tried distinct and group by but none of them working. For i.e. my table is : Number ID Title 1 1 hello 2 1 hello 3 1 hello 4 2 test 5 …

  6. Running total with WHILE loop - social.msdn.microsoft.com

    Sep 30, 2019 · I am looking for a running total solution using not the window functions but a while loop. In this case, I have #t table with 2 fields and some data in @list . So, I need to load data from @list …

  7. Operand data type varchar is invalid for subtract operator

    Apr 20, 2012 · Actually I am trying to create a report in SQL Reporting Services. I need the T-SQL code to be accepted by Query Designer, otherwise it will just create an empty dataset with no fields.

  8. Delete all the row duplicate except one

    Jun 11, 2013 · now , I would like to delete all the row except one. Obviously with a select distinct I can select one but I need to add a lot of new columns and before I'd like to have the table well cleaned. …

  9. identity/sequence based on another column's value

    Dec 28, 2012 · Does SQL Server have any built-in mechanism for populating a column with incrementing numeric values based on the value of another column? I think the best way to illustrate …

  10. Using temp table is much faster than CTE or subquery?

    May 25, 2011 · I found that often splitting complex SQL into parts using temp tables help performance significantly. So, I'm not surprised finding temp tables outperform CTE. There were older discussions …