Skip to content
Advertisement

Select row with a new column for group

In the table Products in the link below, I have 3 columns:

https://www.w3schools.com/sql/trysql.asp?filename=trysql_drop_table

I want to add column “group” to the output of the select statement.

Column group has value using below rule:

Thank you for your help.

HHC

Advertisement

Answer

Use case:

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