Skip to content
Advertisement

How to get specific part string from column

I have two tables one is SifraArtikla

The second table ArtikalUsluge extend the SifraArtikla ID

I need to get from PuniNaziv column ‘PW60’ if ArtikalID is 1 else if ID is 2 ‘PW120’ else if ID is 3 ‘pw250’ I tried with if else statment but it didn’t work. Can anyone give me some hints please.

This is what I want to achive

Advertisement

Answer

You could use the base string functions to identify the value as being in between the text MASTER and sa. Then, join the two tables to restrict to only the ID values in the first table from whose text you want to extract.

Demo

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