INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

SQL SERVER es posible obtener como filas individuales resultados que están almacenados en una column

SQL SERVER es posible obtener como filas individuales resultados que están almacenados en una column

SQL SERVER es posible obtener como filas individuales resultados que están almacenados en una column

(OP)
Hola. En SQL SERVER es posible obtener como filas individuales resultados que están almacenados en una columna como valores separados por comas?

Es decir... tengo una columna llamada NOMBRE que tiene valores:
# Nombre
1 Sergio,Juan
2 Roberto,Mario,Sergio
3 Juan,Ignacio,Sergio,Mario

Si pudiera obtener los nombres únicos, uno en cada fila de la respuesta sería excelente. O sea que el SELECT me devolviera un conjunto de resultados similar al siguiente:

# Nombre
1 Sergio
2 Juan
3 Roberto
4 Mario
5 Ignacio
Sino, me conformo con obtener los nombres en filas y después haré una consulta del tipo DISTINCT sobre esos resultados.

Muchas gracias a la comunidad!

RE: SQL SERVER es posible obtener como filas individuales resultados que están almacenados en una column

use this one if your field is varchar(8000) or less - or use one of the clr's mentioned on the link
http://www.sqlservercentral.com/articles/Tally+Tab...

it will return 1 row per split as you asked for, and then you can do the distinct to get unique values

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close