sys.allocation_units

Technical Article

RE: Combining Two Grouping Select Statements

  • Reply

This is not what the poster is asking for. They are requesting that in the same query, return both scalar and non-scalar aggregates, ie count of all and also count of a single group, and given the format the poster wanted (repeating the scalar aggregate in each row), none of the solutions presented so far […]

You rated this post out of 5. Change rating

2003-06-19

Technical Article

RE: Combining Two Grouping Select Statements

  • Reply

You need to use a CASE statment instead of WHERE clause to restrict the values going into the aggregate. The code below assumes that you can't have negative values in dbo.Defect_Data.SUMDEFECTS. So you don't need to restrict the input to the SUM. If you did, you would use a CASE statement as with QDefectCount, but […]

You rated this post out of 5. Change rating

2003-06-19

1 reads

Technical Article

RE: Combining Two Grouping Select Statements

  • Reply

You need to use a CASE statment instead of WHERE clause to restrict the values going into the aggregate. The code below assumes that you can't have negative values in dbo.Defect_Data.SUMDEFECTS. So you don't need to restrict the input to the SUM. If you did, you would use a CASE statement as with QDefectCount, but […]

You rated this post out of 5. Change rating

2003-06-19

Technical Article

RE: Strange error from QA

  • Reply

I made the chnages but still got the error. I am psoting the entire query in cae it might help. ========================================== DECLARE @ID INT DECLARE @Name varchar(200) DECLARE @Text nVarchar(2000) DECLARE @cDate datetime DECLARE @ColID int DECLARE @Type varchar(10) -- Declare the cursor DECLARE CURSOR_OBJ CURSOR LOCAL FAST_FORWARD FOR SELECT TOP 100 PERCENT dbo.sysobjects.id, dbo.sysobjects.name, […]

You rated this post out of 5. Change rating

2003-06-18

Blogs

Small Data SF 2024

By

I can’t remember how I heard about Small Data SF 2024, but it caught...

A New Word: Moledro

By

moledro – n. a feeling of resonant connection with an author or artist you’ll...

Snowflake + Azure blob

By

Let’s go back to data platforms today and I want to talk about a...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers