About 2,420,000 results
Open links in new tab
  1. What's the purpose of SQL keyword "AS"? - Stack Overflow

    Nov 12, 2010 · You can set table aliases in SQL typing the identifier right after the table name. SELECT * FROM table t1; You can even use the keyword AS to indicate the alias. SELECT * FROM table AS t1; …

  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 OrderNumber LIKE '%' + @

  3. 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 need to …

  4. 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 1 John

  5. sql - What is the difference between JOIN and INNER JOIN ... - Stack ...

    SELECT * FROM table INNER JOIN otherTable ON table.ID = otherTable.FK Is there any difference between the statements in performance or otherwise? Does it differ between different SQL …

  6. sql - Delete duplicate rows keeping the first row - Stack Overflow

    10 To delete the duplicate rows from the table in SQL Server, you follow these steps: Find duplicate rows using GROUP BY clause or ROW_NUMBER () function. Use DELETE statement to remove the duplicate …

  7. How do I rename a column in a database table using SQL?

    Oct 6, 2008 · 155 If I wish to simply rename a column (not change its type or constraints, just its name) in an SQL database using SQL, how do I do that? Or is it not possible? This is for any database …

  8. sql server - SQL MAX of multiple columns? - Stack Overflow

    Mar 8, 2012 · How do you return 1 value per row of the max of several columns: TableName [Number, Date1, Date2, Date3, Cost] I need to return something like this: [Number, Most_Recent_Date, Cost] …

  9. sql server - Database stuck in "Restoring" state - Stack Overflow

    Ran into a similar issue while restoring the database using SQL server management studio and it got stuck into restoring mode. After several hours of issue tracking, the following query worked for me.

  10. SQL WHERE.. IN clause multiple columns - Stack Overflow

    SELECT * FROM table1 WHERE (CM_PLAN_ID, Individual_ID) IN ( SELECT CM_PLAN_ID, Individual_ID FROM CRM_VCM_CURRENT_LEAD_STATUS WHERE Lead_Key = :_Lead_Key ) But the WHERE..IN …