WeTi
asked on
SQL Query questions about changing column name.
Dear experts
I would like to run a query:
This query will show 2 selections in one table with result count. Now problem here is that I want the column name change to Processed and Not_Processed, this is not working right now, it shows No column name.
How do i do?
Code below, thanks.
SELECT (
SELECT count(*)
FROM [Prod].[Data].[IncomingUpd ate] As Processed
WHERE InsertTime >= DATEADD(day,-10, getdate()) AND Is = 'P'
),
(
SELECT count(*)
FROM [Prod].[Data].[IncomingUpd ate] As Not_Processed
WHERE InsertTime >= DATEADD(day,-10, getdate()) AND Is is null
)
I would like to run a query:
This query will show 2 selections in one table with result count. Now problem here is that I want the column name change to Processed and Not_Processed, this is not working right now, it shows No column name.
How do i do?
Code below, thanks.
SELECT (
SELECT count(*)
FROM [Prod].[Data].[IncomingUpd
WHERE InsertTime >= DATEADD(day,-10, getdate()) AND Is = 'P'
),
(
SELECT count(*)
FROM [Prod].[Data].[IncomingUpd
WHERE InsertTime >= DATEADD(day,-10, getdate()) AND Is is null
)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER