• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help needed in SQL in joining tables

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have to create a join of two tables with the following fields:
User_x
Full_Name
Login_Name
Group_List

Group_x
Group_name
Groupid

In User_x table grouplist comprises of list of groups a user belongs to separated by a semi colon. e.g. 12;78;65

Now I need to create a join where I get a list of all the users with the group they belong to.
The result set should look like this
User Groupname
Tom Group1
Peter Group2
Kathy Group2


and so on...
Actual SQL wil be appreciated.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
shitalsupase@rediffmail.com

Hello Nee,

See i think there is basically a problem in table design itself. First of all u should have the tables in the normalised form, at least in 1NF . Means u should not have more than one value or a list of values at the intersection of a row & column. After that if the tables r normalised means if they r designed in some way like :

User_x(Full_Name,Login_Name,Group_id)

& Groups(Groupid,Group_name)


then it will definately solve the problem.if u can have design like this they i can give u the solution for ur problem also.Atually this is what u should have.

Ok . Try it.
 
Yeah, but how did the squirrel get in there? Was it because of the tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic