I have the following inline SQL code, running on an AS400. The IF comes up as unexpected but I don’t understand why. What I’m trying to do is to build a stored procedure to update, or insert, a …
Tag: rowcount
How to get row count based on other column groups
I need to count the number of dates with which the invoices are made to certain customers in each month Consider the table named Table1 I tried the folllowing code and the result was The result I need should count the column named branch based on column month, the desired result is Here rowcount is based on both column branch
Is there a way to also select the row count from the same following query?
Would I be able to add a rowcount to this same query or would I need to create a separate one? Answer You can do it with a cte
Serial number auto generation
Facing issue in auto generation of serial number. How can i use row_number() in proper manner or is there any alternative to achieve the expected results? Note: I want to write query without using CASE. Current Results: Expected Results: Answer You can try to use ROW_NUMBER window function in a subquery, then use DENSE_RANK window function to create no column