About 292,000 results
Open links in new tab
  1. SQL IsNull with SELECT subquery in a query - Stack Overflow

    Nov 17, 2016 · With IsNUll it outputs the error bellow. Could anyone point me in a right direction? I have null on that specific column, and I can get the right results from another table. I don't know how to do it. Subquery returned more than 1 value.

  2. sql server - Using isnull() function and subquery - Stack Overflow

    Jan 31, 2018 · I am trying to use isnull function, because in many cases, the denominator is 0 and bringing it in a subquery. It shows error - 'Invalid Column name' - ATFTE and SATFTE. How can I rectify it?

  3. Assistance with subquery in an ISNULL - SQLServerCentral

    May 6, 2011 · SELECT ISNULL (ISNULL (status_date, closed_date), received_date). FROM #test a. WHERE a.case_status = 'filed' AND. SELECT 1. FROM #test b. WHERE(case_status = 'filed') and (a.case_sk =...

  4. How to handle NULL in a SQL subquery? - Stack Overflow

    Feb 22, 2012 · You need to use SUM() and ISNULL() in different order, like: select cast(sum(isnull(TotalDays, 0)) as decimal(20,2)) as totdays And in second case you can use next: datediff(day, isnull(DateFrom, getdate()), getdate()) This way you can eliminate null values before calculation/conversion.

  5. ISNULL (Transact-SQL) - SQL Server | Microsoft Learn

    Sep 3, 2024 · A. Use ISNULL with AVG. The following example finds the average of the weight of all products. It substitutes the value 50 for all NULL entries in the Weight column of the Product table. USE AdventureWorks2022; GO SELECT AVG(ISNULL(Weight, 50)) FROM Production.Product; GO Here's the result set. 59.79 B. Use ISNULL

  6. ISNULL within a subquery - SQL Server Forums - SQLTeam.com

    Jun 18, 2009 · I'm having some difficulty using the ISNULL function within a sub- query. I'm using the below code to find the most recent payment received date that is less that a 100 days before the payment due date. This works fine, however some records don't have a received date and use a DD claim date instead. This would be found using:

  7. SQL Server: Subqueries - TechOnTheNet

    This SQL Server tutorial explains how to use subqueries in SQL Server (Transact-SQL) with syntax and examples. A subquery is a query within a query. In SQL Server (Transact-SQL), you can create subqueries within your SQL statements.

  8. SQL ISNULL Function Examples - MSSQLTips.com - SQL Server

    Mar 18, 2021 · The ISNULL() function can be used anywhere that the SQL syntax allows for the use of a function but the main use case for this function is in the SELECT list of a SQL query when you want to convert any NULL values being returned to something more descriptive.

  9. Case statement with subquerySQLServerCentral Forums

    Jun 7, 2013 · I tried putting an ISNULL around the subquery and it just returned nothing in that case. The case statement is part of the result set from the SELECT. It runs but instead of returning the 3...

  10. ISNULL or any alternative in sql server when not data present for subquery

    Sep 18, 2013 · isnull work on the "column" level, what you need is if a row is null, then print something else. I would UNION ALL your select with a "dummy" select containing only one row with the data you want to be displayed in case nothing returns, then …

  11. Some results have been removed
Refresh