The IF Statement in a T-SQL Query
I’ve seen quite a few posts from people asking how to do something like this:
SELECT
a.ID
, IF a.MyChar = 'A' THEN...
2011-07-07
158,513 reads
I’ve seen quite a few posts from people asking how to do something like this:
SELECT
a.ID
, IF a.MyChar = 'A' THEN...
2011-07-07
158,513 reads
Just got an email from the Space Coast User Group that Maciej Pilecki (@DrHouseOfSQL) will be doing a presentation to...
2011-07-07
617 reads
If it hasn’t happened already we should be close to beginning the election cycle for the 2012 election. Last year...
2011-07-07
606 reads
First - I'll get the "what's a pipeline got to do with Integration Services" question out of the way. The "pipeline" I'm referring to here is the word commonly...
2011-07-07
15 reads
First - I'll get the "what's a pipeline got to do with Integration Services" question out of the way. The "pipeline" I'm referring to here is the word commonly...
2011-07-07
43 reads
We’re going to be hosting two pre-conference seminars this year in Orlando on Friday, September 23rd, and we’re looking for...
2011-07-07
423 reads
First - I'll get the "what's a pipeline got to do with Integration Services" question out of the way. The "pipeline"...
2011-07-07
3,457 reads
I wrote about some skeletons in the Denali’s closet here. Let’s also put some good on the table. Very handy...
2011-07-06
1,229 reads
We have had a bit of a lag between meetings for the User Group of Las Vegas. In June, a meeting was scheduled but did not happen. The cause...
2011-07-06
9 reads
We have had a bit of a lag between meetings for the User Group of Las Vegas. In June, a...
2011-07-06
490 reads
By SQLPals
How to Clear the SSMS Cache (SSMS 21 and Later) Updated...
By Arun Sirpal
“What exactly did it do on my server?” is the first question a DBA...
By James Serra
Microsoft shared a broad set of Fabric, Power BI, and SQL updates at FabCon...
Comments posted to this topic are about the item Let's Talk Certifications
Comments posted to this topic are about the item The Hidden Security Risks of...
Comments posted to this topic are about the item The Empty Aggregate
I have this table in a SQL Server 2025 database:
CREATE TABLE [dbo].[CustomerOrder] ( [OrderID] [int] NULL, [CustomerID] [int] NULL, [total] [money] NULL ) ON [PRIMARY] GOWhat is returned from this code? (answers are for the sum and then the count)
SELECT SUM(total) AS sum,
COUNT(total) AS count
FROM dbo.CustomerOrder;
See possible answers