About 2,520,000 results
Open links in new tab
  1. How do I perform an IF...THEN in an SQL SELECT?

    Sep 15, 2008 · 2059 The CASE statement is the closest to IF in SQL and is supported on all versions of SQL Server.

  2. SQL: IF clause within WHERE clause - Stack Overflow

    Sep 18, 2008 · Is it possible to use an IF clause within a WHERE clause in MS SQL? Example: WHERE IF IsNumeric(@OrderNumber) = 1 OrderNumber = @OrderNumber ELSE …

  3. sql - Find all tables containing column with specified name - Stack ...

    @Revious INFORMATION_SCHEMA views included in SQL Server comply with the ISO standard definition for the INFORMATION_SCHEMA., sys.columns, sys.tables is Microsoft Sql Server …

  4. sql - Copy data into another table - Stack Overflow

    How to copy/append data from one table into another table with same schema in SQL Server? Edit: let's say there is a query select * into table1 from table2 where 1=1 which creates table1 …

  5. SQL - Select first 10 rows only? - Stack Overflow

    Dec 12, 2009 · How do I select only the first 10 results of a query? I would like to display only the first 10 results from the following query: SELECT a.names, COUNT(b.post_title) AS num FROM

  6. Remove all spaces from a string in SQL Server - Stack Overflow

    May 3, 2012 · What is the best way to remove all spaces from a string in SQL Server 2008? LTRIM(RTRIM(' a b ')) would remove all spaces at the right and left of the string, but I also …

  7. IN vs OR in the SQL WHERE clause - Stack Overflow

    Jun 19, 2010 · When dealing with big databases, which performs better: IN or OR in the SQL WHERE clause? Is there any difference about the way they are executed?

  8. sql - Efficiently convert rows to columns - Stack Overflow

    I'm looking for an efficient way to convert rows to columns in SQL Server, I heard that PIVOT is not very fast, and I need to deal with lot of records. This is my example: Id Value ColumnName …

  9. Get the last day of the month in SQL - Stack Overflow

    105 From SQL Server 2012 you can use the EOMONTH function. Returns the last day of the month that contains the specified date, with an optional offset. Syntax

  10. How to select unique records by SQL - Stack Overflow

    How to select unique records by SQL Asked 16 years ago Modified 1 year, 10 months ago Viewed 746k times