Dividir contenido de una columna en dos o mas en PostgreSQL

Hoy me encontré con una tabla persona con los datos apellidos en un solo campo por lo que opte por buscar la forma mediante sql de obtener por separado cada apellido en una columna distinta (apellido paterno, apellido materno).

Luego de unos minutos de realizar algunas búsquedas la solución fue la siguiente:

SELECT pers_apellidos,split_part(pers_apellidos,' ',1) AS apellido_paterno, split_part(pers_apellidos,' ',2) AS apellido_materno FROM persona

La solución fue utilizar una función que separa cadenas según un delimitador:

split_part()

SINTAXIS

split_part(string,delimiter,field)

string: la cadena que queremos separar delimiter: el delimitador field: la posición de texto que queremos mantener

quedando:

split-posgresql.png

listo!!! ahora su respectivo UPDATE.

Comentarios

1. El Lunes, Febrero 5 2018, 14:04 por Samuel (Buenos Aires)

Buenisimo me re sirvio. Muchas gracias!

2. El Lunes, Febrero 19 2018, 19:24 por Tania

Genial! fue de mucha ayuda, muchas gracias! :)

3. El Jueves, Octubre 4 2018, 03:30 por minecraft

I pay a quick visit everyday some blogs and information sites to read articles, except
this webpage gives feature based content.

4. El Viernes, Octubre 5 2018, 02:47 por minecraft

This is a topic that is close to my heart... Best wishes!
Where are your contact details though?

5. El Sábado, Octubre 6 2018, 07:52 por minecraft

Ahaa, its nice discussion concerning this piece of writing
at this place at this webpage, I have read all that, so at this time
me also commenting here.

6. El Sábado, Octubre 6 2018, 20:51 por minecraft

I am extremely impressed along with your writing talents and also with the format
in your blog. Is this a paid theme or did you modify it yourself?

Either way stay up the excellent quality writing, it is rare
to peer a nice blog like this one nowadays..

7. El Domingo, Octubre 7 2018, 00:44 por minecraft

Every weekend i used to go to see this website,
for the reason that i want enjoyment, since this this web site conations actually fastidious funny stuff
too.

8. El Domingo, Octubre 7 2018, 07:56 por minecraft

What's Taking place i am new to this, I stumbled upon this I've found It absolutely useful and it has helped me out loads.
I am hoping to give a contribution & assist different customers like its helped me.
Good job.

9. El Domingo, Octubre 7 2018, 17:11 por minecraft

Very quickly this website will be famous amid
all blogging viewers, due to it's pleasant posts

10. El Domingo, Octubre 7 2018, 21:30 por minecraft

Amazing! Its genuinely amazing piece of writing,
I have got much clear idea concerning from this
article.

11. El Lunes, Octubre 8 2018, 09:39 por minecraft free download 2018

You're so interesting! I do not think I've truly read anything like this before.

So nice to find someone with genuine thoughts on this topic.
Seriously.. thank you for starting this up. This web site is something that's needed on the
web, someone with a little originality!

12. El Lunes, Octubre 8 2018, 10:30 por minecraft free download 2018

Whoa! This blog looks just like my old one! It's on a completely different subject but
it has pretty much the same layout and design. Wonderful choice of colors!

13. El Lunes, Octubre 8 2018, 13:01 por minecraft free download 2018

Do you mind if I quote a couple of your articles as long as I provide credit and sources back
to your site? My website is in the very same niche as
yours and my visitors would genuinely benefit from a lot of the information you provide here.
Please let me know if this ok with you. Thanks a lot!

14. El Lunes, Octubre 8 2018, 13:04 por minecraft free download 2018

I am extremely inspired together with your writing talents and
also with the format for your blog. Is this a
paid topic or did you customize it your self?
Anyway keep up the excellent high quality writing, it's uncommon to peer a nice blog like this one today..

15. El Lunes, Octubre 8 2018, 22:01 por minecraft free download 2018

Thanks for the marvelous posting! I genuinely enjoyed reading it, you might be a great author.I
will remember to bookmark your blog and will eventually come back later in life.

I want to encourage continue your great posts,
have a nice day!

16. El Martes, Octubre 9 2018, 12:57 por minecraft free download 2018

I have been exploring for a little bit for any high-quality articles or weblog posts on this sort of
house . Exploring in Yahoo I ultimately stumbled upon this website.
Reading this info So i'm satisfied to express that I've an incredibly just right uncanny feeling I discovered just what I needed.
I so much surely will make certain to don?t omit this web site and provides it a
glance on a relentless basis.

17. El Martes, Octubre 9 2018, 13:41 por minecraft free download 2018

Please let me know if you're looking for a article author for your site.
You have some really good articles and I feel I would be a good asset.
If you ever want to take some of the load off, I'd absolutely love to write some articles for your blog in exchange for a link back to
mine. Please blast me an e-mail if interested. Regards!

18. El Martes, Octubre 9 2018, 15:44 por minecraft free download 2018

Hello it's me, I am also visiting this site on a regular
basis, this site is genuinely pleasant and the viewers are really sharing good
thoughts.

19. El Martes, Octubre 9 2018, 18:24 por minecraft free download 2018

With havin so much content do you ever run into any problems of plagorism or
copyright violation? My site has a lot of exclusive content I've either created myself or
outsourced but it looks like a lot of it is popping it up all over the
internet without my permission. Do you know any ways to help prevent content from
being ripped off? I'd truly appreciate it.

20. El Miércoles, Octubre 10 2018, 01:13 por minecraft free download 2018

I've read several just right stuff here. Certainly
value bookmarking for revisiting. I wonder how much attempt you place to make the sort of excellent
informative web site.

21. El Jueves, Octubre 11 2018, 05:29 por minecraft free download 2018

Its such as you learn my mind! You seem to grasp a lot approximately this, such as
you wrote the e book in it or something. I believe that you
can do with some percent to drive the message home a bit,
however instead of that, this is fantastic blog.
A great read. I will definitely be back.

22. El Jueves, Octubre 11 2018, 07:28 por minecraft free download 2018

Amazing! This blog looks exactly like my old one! It's on a entirely different subject but
it has pretty much the same layout and design. Excellent choice of colors!

23. El Miércoles, Octubre 17 2018, 23:17 por tinder dating site

I'm truly enjoying the design and layout of your blog.
It's a very easy on the eyes which makes it much more pleasant for me to come
here and visit more often. Did you hire out a designer to create your theme?
Fantastic work!

24. El Jueves, Octubre 18 2018, 08:22 por minecraft secret free download

My brother recommended I might like this web site.
He was entirely right. This post truly made my day.
You cann't imagine simply how much time I had
spent for this info! Thanks!

25. El Jueves, Octubre 18 2018, 16:11 por minecraft secret free download

Hey I know this is off topic but I was wondering if you knew of any widgets I
could add to my blog that automatically tweet my newest twitter updates.

I've been looking for a plug-in like this for quite some time and was hoping maybe
you would have some experience with something like this.
Please let me know if you run into anything. I truly
enjoy reading your blog and I look forward to your new updates.

26. El Viernes, Octubre 19 2018, 21:53 por Coconut Oil Benefits

It's very easy to find out any matter on net as compared to textbooks, as I found this post at this web page.

27. El Domingo, Octubre 21 2018, 15:27 por Health Benefits of Coconut Oil

I could not refrain from commenting. Very well written!

28. El Martes, Octubre 23 2018, 03:02 por Benefits of Coconut Oil

Heya i'm for the first time here. I found this board and I find
It truly useful & it helped me out a lot.

I hope to give something back and help others like you aided me.

29. El Martes, Octubre 23 2018, 06:23 por Coconut Oil Benefits

Excellent post. I will be experiencing a few of these issues as well..

30. El Miércoles, Octubre 24 2018, 11:58 por Benefits of Coconut Oil

I'm extremely impressed with your writing skills as well as with the layout on your blog.
Is this a paid theme or did you modify it yourself?

Anyway keep up the excellent quality writing, it's
rare to see a nice blog like this one these days.

31. El Miércoles, Octubre 24 2018, 21:51 por Health Benefits of Coconut Oil

Very nice post. I just stumbled upon your blog and wanted to say that I have really enjoyed browsing your weblog posts.
After all I'll be subscribing for your feed and I'm hoping you write again soon!

32. El Viernes, Noviembre 2 2018, 20:37 por descargar facebook

Hello to all, for the reason that I am actually keen of reading this web site's post to
be updated daily. It includes pleasant data.

33. El Viernes, Noviembre 2 2018, 20:47 por descargar facebook

Please let me know if you're looking for a article author for your blog.
You have some really good articles and I feel I would be a good asset.
If you ever want to take some of the load off, I'd really like to write some content for your blog in exchange for a link back to mine.
Please send me an e-mail if interested. Many thanks!

34. El Sábado, Noviembre 3 2018, 13:51 por quest bars cheap

My brother recommended I may like this web site.

He was totally right. This publish actually made my day.

You can not believe simply how much time I had spent for this information!
Thank you!

35. El Sábado, Noviembre 3 2018, 13:59 por quest bars cheap

Hello my loved one! I want to say that this article is awesome, great written and include approximately all significant
infos. I would like to see extra posts like this .

36. El Domingo, Noviembre 4 2018, 06:43 por quest bars cheap

I've been browsing on-line more than three hours these
days, yet I by no means discovered any interesting article like yours.

It is beautiful price sufficient for me. Personally,
if all webmasters and bloggers made excellent content material as you probably
did, the web shall be a lot more helpful than ever before.

37. El Domingo, Noviembre 4 2018, 12:41 por descargar facebook

Descargar facebook http://twitter.com/descargar_hq descargar facebook

Pretty nice post. I just stumbled upon your
blog and wanted to say that I have truly enjoyed surfing around
your blog posts. After all I will be subscribing to your rss feed and I hope you write
again soon! Descargar facebook http://twitter.com/descargar_hq descargar facebook

38. El Domingo, Noviembre 4 2018, 21:57 por quest bars cheap

Quest bars cheap fitnesstipsnew1 quest bars cheap 516999410492780544 quest bars cheap

I like the valuable info you provide in your articles.

I'll bookmark your weblog and check again here frequently.
I'm quite sure I'll learn a lot of new stuff
right here! Good luck for the next! Quest bars cheap fitnesstipsnew1 quest bars cheap 516999410492780544 quest bars cheap

39. El Domingo, Noviembre 4 2018, 22:55 por descargar facebook

Descargar facebook http://twitter.com/descargar_hq descargar facebook

I like the valuable information you provide in your articles.
I'll bookmark your blog and check again here regularly. I'm quite sure I'll learn a lot of new stuff right here!
Best of luck for the next! Descargar facebook http://twitter.com/descargar_hq descargar facebook

40. El Martes, Noviembre 6 2018, 15:22 por quest bars

Hello, Neat post. There is an issue together with your site in internet explorer, might test this?
IE nonetheless is the marketplace chief and a huge part of folks will miss your excellent writing due to this problem.

41. El Viernes, Noviembre 9 2018, 07:02 por Quest Bars

At this time it seems like BlogEngine is the preferred blogging platform
available right now. (from what I've read) Is that what you are using on your blog?

42. El Viernes, Noviembre 9 2018, 21:45 por What Equipment is Needed for Sling TV

Hi there very cool web site!! Man .. Excellent .. Wonderful ..

I will bookmark your website and take the feeds also? I'm happy to seek out so many
useful information right here within the publish, we'd
like develop more techniques in this regard, thank you for sharing.
. . . . .

43. El Sábado, Noviembre 10 2018, 17:06 por Sling TV

Fantastic goods from you, man. I've understand your stuff previous
to and you are just extremely fantastic. I really like what
you've acquired here, really like what you are saying and the
way in which you say it. You make it enjoyable and you still
take care of to keep it sensible. I can't wait to read far
more from you. This is really a tremendous web site.

44. El Domingo, Noviembre 11 2018, 02:16 por Sling TV

Hi there to every single one, it's in fact a good for me to visit this web page, it consists of important Information.

45. El Domingo, Noviembre 11 2018, 16:49 por Sling TV

Hey just wanted to give you a quick heads up and
let you know a few of the images aren't loading
correctly. I'm not sure why but I think its a linking issue.
I've tried it in two different browsers and both show the same
outcome.

46. El Lunes, Noviembre 12 2018, 09:53 por What Equipment is Needed for Sling TV

Yesterday, while I was at work, my sister stole my iphone and tested to see if it can survive a forty foot drop, just so she can be a youtube sensation. My iPad is now broken and she has 83
views. I know this is completely off topic but I had to share it with someone!

47. El Martes, Noviembre 13 2018, 03:15 por What Equipment is Needed for Sling TV

If you would like to improve your experience simply keep visiting this web page and be updated
with the latest gossip posted here.

48. El Miércoles, Noviembre 14 2018, 11:47 por Sling TV

Hello my family member! I wish to say that this article
is awesome, great written and include almost all important infos.
I would like to look more posts like this .

49. El Jueves, Noviembre 15 2018, 05:52 por Sling TV

Excellent goods from you, man. I have understand your stuff previous to and you are
just extremely wonderful. I actually like
what you've acquired here, certainly like what you are saying and the way in which you say
it. You make it enjoyable and you still care for to keep it sensible.
I can not wait to read much more from you. This is really a terrific site.

50. El Jueves, Noviembre 15 2018, 13:38 por Sling TV

you're actually a excellent webmaster. The website loading
pace is incredible. It seems that you are doing
any unique trick. Moreover, The contents are masterwork.

you have performed a excellent activity in this subject!

51. El Viernes, Noviembre 16 2018, 12:45 por What Equipment is Needed for Sling TV

of course like your web site however you have to check the spelling on several of your posts.
Several of them are rife with spelling issues and I find it
very troublesome to tell the reality however I'll surely come back
again.

52. El Viernes, Noviembre 16 2018, 20:00 por sling tv coupons and promo codes for november 2018

Sling tv coupons and promo codes for november 2018

This page definitely has all of the info I needed concerning this subject and didn't know who
to ask. sling tv coupons and promo codes for november 2018

53. El Domingo, Noviembre 18 2018, 14:12 por What Equipment is Needed for Sling TV

If you want to take a good deal from this post then you
have to apply these methods to your won webpage.

54. El Domingo, Noviembre 18 2018, 18:59 por What Equipment is Needed for Sling TV

Just desire to say your article is as amazing. The clarity
to your publish is just cool and i could assume you're a professional on this subject.

Fine together with your permission let me to seize your RSS
feed to stay updated with approaching post. Thank you one million and please carry on the
rewarding work.

55. El Domingo, Noviembre 18 2018, 21:46 por What Equipment is Needed for Sling TV

My relatives all the time say that I am killing my time here at web, however I know I am getting familiarity everyday by reading such fastidious content.

56. El Martes, Noviembre 20 2018, 11:08 por What Equipment is Needed for Sling TV

Excellent post. I was checking constantly this blog and I'm inspired!
Very useful info particularly the closing section :) I care for such
info much. I used to be looking for this certain information for a long time.

Thanks and good luck.

57. El Miércoles, Noviembre 21 2018, 11:07 por descargar facebook

Saved as a favorite, I like your website!

58. El Jueves, Noviembre 22 2018, 14:09 por descargar facebook

I like reading through a post that will make people think.

Also, many thanks for allowing me to comment!

59. El Martes, Diciembre 4 2018, 14:15 por descargar facebook

Very nice article, exactly what I was looking for.

60. El Jueves, Diciembre 6 2018, 06:44 por descargar facebook

Attractive section of content. I just stumbled upon your blog and in accession capital to assert
that I acquire actually enjoyed account your blog posts.
Any way I'll be subscribing to your augment and even I achievement you access consistently quickly.

61. El Jueves, Diciembre 6 2018, 13:30 por descargar facebook

I blog frequently and I seriously thank you for your information.
This great article has really peaked my interest.
I am going to book mark your blog and keep checking for new information about once per week.
I subscribed to your RSS feed as well.

Añadir un comentario

El código HTML se muestra como texto y las direcciones web se transforman automáticamente.

Discusiones sobre el mismo tema

URL de retroenlace : http://creativapixel.com/blog/index.php?trackback/9

1915 reads