Skip to content
Advertisement

Select every 2nd, 4th row and so on from same column based on specific material

In 1 packing got 2 material and item sequence is 00010 and 00020. What I need is if I input material from item sequence 00010 in where statement which is ‘CB016’ , I can list out all the item sequence 00020.

Table Data

Expected Output

Advertisement

Answer

Window functions are not required here. You need the 20 rows for with there is a 10 row in the same group.

DB Fiddle

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement