Hallo Dear Stackoverflow users.
Working with sql on sql server
I have searched the forum and the internet, but haven’t found information concerning what i want to achieve. Mainly because I don’t know the correct terminology.
I have created a new view, and I would like to filter out different data from a column (ver_klass) to a newly created column.
In the below picture is how my view looks like at the moment.

This is how I would like to represent the view:
ver_rayon |ver_metier |ver_secteur
96 | |
96 | |
| M10 |
| M11 |
| |S1
12 | |
I want to know if it is possible to do that, and how. Thanks a lot
This can be managed with a few
CASEstatements. The idea is to check if the first character ofver_klassisMorSand take a different action on each. So in the first case, if it is neither M,S then the value goes tover_rayon. The second and third cases look forMandSrespectively and store to those columns. Since the row matches only one of the three cases, the other two are NULLed.