Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7806945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:41:45+00:00 2026-06-02T02:41:45+00:00

Hallo Dear Stackoverflow users. Working with sql on sql server I have searched the

  • 0

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.

enter image description here

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:41:46+00:00Added an answer on June 2, 2026 at 2:41 am

    This can be managed with a few CASE statements. The idea is to check if the first character of ver_klass is M or S and take a different action on each. So in the first case, if it is neither M,S then the value goes to ver_rayon. The second and third cases look for M and S respectively and store to those columns. Since the row matches only one of the three cases, the other two are NULLed.

    SELECT
     ...
     ...
     CASE WHEN LEFT(ver_klass, 1) <> 'S' AND LEFT(ver_klass, 1) <> 'M' THEN ver_klass ELSE NULL END AS ver_rayon,
     CASE WHEN LEFT(ver_klass, 1) = 'M' THEN ver_klass ELSE NULL END AS ver_metier,
     CASE WHEN LEFT(ver_klass, 1) = 'S' THEN ver_klass ELSE NULL END AS ver_secteur,
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hallo, I have read Easy object binding to Treeview Node , but still have
Hello dear users of the stackoverflow! I really like the search form on this
Hallo I would like to sanitize input from Ruby, but simultaneously not have it
Hallo, I am configuring Solr. Everything ist working fine but one thing appears to
Button createEventButton = (Button)findViewById(R.id.NewEventButton); Button createPageButton = (Button)findViewById(R.id.NewPageButton); Hallo I have searched all over
Hallo, Recently I have read a couple of posts on varous sites and blogs
Hallo all. if i have week number 42 and i need to know what
Hallo everyone, i have a list of nodes ListNode and i want to draw
Hallo I have this script: <? require(lib2/config.inc.php); require(lib2/tpl.class.php); require(lib2/db.class.php); require(lib2/um.class.php); $tpl = new template(templates,
Hallo, how can I pass more parameters to usort? I have different functions, which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.