Re: SQL Query Help



I believe that one of these resources will point you in a direction that
will work for you:

Lists -Field Concatenation
http://groups.google.com/group/microsoft.public.sqlserver.programming/msg/2d85bf366dd9e73e

Lists -Field Concatenation ( For SQL 2000 & 2005 )
http://groups.google.com/group/microsoft.public.sqlserver.programming/msg/7e5b4c8a9b9b968a

Lists -Field Concatenation, One Field to Itself for string
SQL 2000
http://omnibuzz-sql.blogspot.com/2006/06/concatenate-values-in-column-in-sql.html
SQL 2005
http://sqlblogcasts.com/blogs/tonyrogerson/archive/2006/07/06/871.aspx
http://www.projectdmx.com/tsql/rowconcatenate.aspx


--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous

You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf


"Hotmail" <Hotmail@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1698075B-E076-4749-AD8A-B4F3F66AD2C2@xxxxxxxxxxxxxxxx
I am a bit of a newbie to SQL Queries and need some help with the following
query.

I have two tables in SQL 2000 which hold info about user and roles.

In the first table I have a set of user info containing the user name and
its email address. the user name is the primary key in this table.

In the second table I have a set of role information which contains the
role
name, role email address and a reference to the user who holds that role.
The
user can be a member of many roles so he can be referenced in the roles
table
maultiple times.

What I want is to output is an ammalgameted view of this data keyed on the
user name as follows:-

user1, user1 email address, role1 email address, role2 email address ...
user2, user2 email address, role3 email address, role4 email address...

I created a basic select qury between the two tables but it only produced
the records on a separate row each. How can I get the multiple roles to
link
to the user in a single row?

Thanks
Hotmail



.



Relevant Pages

  • How Alerts can work for Overdue Issues
    ... Adding a choice list for every Issue list in the Sharepoint sites. ... DTS package to the SQL report server (The only reason why this was done ... Making a new SQL Report for SQL Reporting Services via Visual ... The Table is Userdata (All of the Issue Lists are in this ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: what are cursors in sql???
    ... This shows that you don't know SQL ... traditional comma. ... It makes life easier if the lists in the input strings start and end ... INSERT INTO ParmList ...
    (comp.databases.ms-sqlserver)
  • Re: Linked List Boxes on Form
    ... Dim sql as string ... Sylvain Lafontaine, ing. ... shows the corresponding Employees of the selected Department. ... two lists are NOT linked because the SQL statement ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Parameters Question
    ... Here's how to do parameterize queries in Microsoft Access 2003. ... Access 2003 database than it would be for SQL Server using OleDB. ... using concatenation to build dynamic SQL SELECT...statement. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Hibernate: having trouble saving a LIST of objects to database.
    ... I want to create a Group object, ... The generated SQL and error message is: ... private String name; ... (Lists are ordered; relationships in SQL are by default ...
    (comp.lang.java.programmer)