General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Hi Michael,
I think you're after:
SELECT SUM(IIF(x > 3,1,0)) AS counter FROM table1
Gavin...
>I'm trying to increment a counter in a SQL statement based on a condition. I've seen the code before somewhere, but I can't find it. It's something like this:
>
>select max(iif(x>3,1,0),1) as counter ;
> from table1
>
>
>
>This code isn't right, far from it, but there was someway to increment the "counter" that I can't remember. Does anyone have any idea what I'm talking about?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only