Separate string data from a table into other tables

Asked

Viewed 56 times

0

Good morning, I have a table called TP_SAN_SRV, which is the table that has the blood type and blood factor, but I need to separate them in two, where the blood type and blood factor are separated.

I looked around and saw that you can use the string split, but I could not use to separate words together and yes when it comes with one or more words.

Does anyone have any idea what I might use?

I use mysql server.

Thank you.

  • If you say you use Mysql Server why you tagged "oracle"?

  • It was just a lack of attention. Obg.

1 answer

0


Wow, I passed something like that a little while ago and I couldn’t find any content that would help me, I had to ask a friend for help. I think you can solve your problem with this:

SELECT SUBSTR (tp_san_srv,1,1) as TIPO_SANGUE, SUBSTR (tp_san_srv,2,1) as Tp_SANGUE_FATOR FROM SRH2.servidor;

Then just adapt to the name of your columns

  • 1

    Obg. It worked here adapting to my schema.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.