Skip to content

How to replace identical values with incremental integers?

I have this SQL select: The output will look something like this: How can I replace the identical values of UserId with incremental integers, so that the output will look something like this: I have tried grouping the identical UserId rows first then joining it with the same table while having an incremental …

BOM Explosion with Blanks

I have a simple BOM table that contains a parent and a child column. Every row contains values. There are no blanks. To bring that table into a BI-Tool I need to add blank values for the parents, like …

SQL Order By on multiple columns containing Nulls

I have a table containing multiple columns, and I want to order by three of the columns within the table. I want to order by lot, then unit, and lastly number. Lot and Unit can contain nulls (need them listed at the bottom) whereas Number column does not contain Null. I’ve tried a bunch of case statemen…