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

    Sep 15, 2008 · The CASE statement is the closest to IF in SQL and is supported on all versions of SQL Server. SELECT CAST( CASE WHEN Obsolete = 'N' or InStock = 'Y' THEN 1 ELSE 0 …

  2. How can I use variables in an SQL statement in Python?

    I have the following Python code: cursor.execute("INSERT INTO table VALUES var1, var2, var3,") where var1 is an integer. var2 and var3 are strings. How can I write the variable …

  3. SQL query to select dates between two dates - Stack Overflow

    Feb 26, 2011 · I have a start_date and end_date. I want to get the list of dates in between these two dates. Can anyone help me pointing the mistake in my query. select Date,TotalAllowance …

  4. SQL query to insert datetime in SQL Server - Stack Overflow

    SQL query to insert datetime in SQL Server Asked 13 years ago Modified 2 years, 7 months ago Viewed 1.5m times

  5. When should I use semicolons in SQL Server? - Stack Overflow

    While checking some code on the web and scripts generated by SQL Server Management Studio I have noticed that some statements are ended with a semicolon. So when should I use it?

  6. sql - Using the WITH clause in an INSERT statement - Stack Overflow

    The problem here is with your INSERT INTO statement, which is looking for VALUES or SELECT syntax. INSERT INTO statement can be used in 2 ways - by providing VALUES explicitly or by …

  7. What is the use of the square brackets [] in sql statements?

    Whatever word becomes colourful in your SQL management studio, should be surrounded by brackets if you want to use them as column / table / sp / etc. names. In MySQL angled single …

  8. sql - How to get the identity of an inserted row? - Stack Overflow

    The OUTPUT clause of the INSERT statement will let you access every row that was inserted via that statement. Since it's scoped to the specific statement, it's more straightforward than the …

  9. SQL Server - stop or break execution of a SQL script

    Mar 19, 2009 · Is there a way to immediately stop execution of a SQL script in SQL server, like a "break" or "exit" command? I have a script that does some validation and lookups before it …

  10. How can I introduce multiple conditions in LIKE operator?

    Sep 7, 2009 · Excellent. Exactly what I needed to remove hard-coded values from my code. My string masks are stored in a configuration table. The old code had each one hard-coded. This …