About 641,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.

  2. sql - Is it possible to specify condition in Count ()? - Stack Overflow

    Is it possible to specify a condition in Count()? I would like to count only the rows that have, for example, "Manager" in the Position column. I want to do it in the count statement, not using WH...

  3. sql server - IF Condition in an SQL query - Stack Overflow

    Apr 20, 2012 · I'm a newbie to SQL Server. Please help me to write the following Logic in a query.

  4. How to use "and" and "or" in a "Where" clause - Stack Overflow

    I have a query that is gathering information based on a set of conditions. Basically I want to know if a location has paid out more than $50 for the day OR the comment section has the word …

  5. sql - How do I use select with date condition? - Stack Overflow

    Jan 20, 2009 · In sqlserver, how do I compare dates? For example: Select * from Users where RegistrationDate >= '1/20/2009' (RegistrationDate is datetime type) Thanks

  6. mysql - SQL WHERE condition is not equal to? - Stack Overflow

    Nov 15, 2019 · DELETE FROM table WHERE id <> 2 As @Frank Schmitt noted, you might want to be careful about the NULL values too. If you want to delete everything which is not 2 …

  7. sql - how do I select a column based on condition? - Stack Overflow

    I have a variable called @status which I set before this select statement:

  8. Building dynamic where condition in SQL statement

    I want to build custom Where condition based on stored procedure inputs, if not null then I will use them in the statement, else I will not use them. if @Vendor_Name is not null begin set @

  9. How do I query for all dates greater than a certain date in SQL …

    Mar 4, 2010 · How do I query for all dates greater than a certain date in SQL Server? Asked 13 years, 6 months ago Modified 3 years ago Viewed 2.1m times

  10. SQL sum with condition - Stack Overflow

    I currently have a large SQL statement which i add the following line to in order to get the total cash for each transaction ID (which are unique): select sum (cash) from Table a where …