About 177,000 results
Open links in new tab
  1. sql - Case in Select Statement - Stack Overflow

    Jan 7, 2013 · I have an SQL statement that has a CASE from SELECT and I just can't get it right. Can you guys show me an example of CASE where the cases are the conditions and the …

  2. 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 …

  3. SQL WITH clause example - Stack Overflow

    Sep 23, 2012 · The SQL WITH clause is basically a drop-in replacement to the normal sub-query. Syntax For The SQL WITH Clause The following is the syntax of the SQL WITH clause when …

  4. CASE .. WHEN expression in Oracle SQL - Stack Overflow

    Since web search for Oracle case tops to that link, I add here for case statement, though not answer to the question asked about case expression: CASE WHEN grade = 'A' THEN …

  5. Best way to do nested case statement logic in SQL Server

    I'm writing an SQL Query, where a few of the columns returned need to be calculated depending on quite a lot of conditions. I'm currently using nested case statements, but its getting messy. …

  6. Nested select statement in SQL Server - Stack Overflow

    Check for more subquery rules and subquery types. More examples of Nested Subqueries. IN / NOT IN – This operator takes the output of the inner query after the inner query gets executed …

  7. SQL Case Expression Syntax? - Stack Overflow

    Aug 7, 2008 · Search conditions are detailed in the Transact-SQL User’s Guide. then precedes the expression that specifies a result value of case. expression is a column name, a constant, …

  8. sql - sqlplus statement from command line - Stack Overflow

    I'm able to execute your exact query by just making sure there is a semicolon at the end of my select statement. (Output is actual, connection params removed.) echo "select 1 from dual;" | …

  9. How to use a SQL SELECT statement with Access VBA

    Jun 13, 2012 · I have a combobox whose value I want to use with a SQL WHERE clause. How do you run a SELECT statement inside VBA based on the combobox value?

  10. How do I UPDATE from a SELECT in SQL Server? - Stack Overflow

    Feb 25, 2010 · In SQL Server, it is possible to insert rows into a table with an INSERT.. SELECT statement: INSERT INTO Table (col1, col2, col3) SELECT col1, col2, col3 FROM other_table …