Re: string from column value

From: Louis Davidson (dr_dontspamme_sql_at_hotmail.com)
Date: 03/03/04


Date: Wed, 3 Mar 2004 17:23:42 -0600

Yeah, but that is clearly not his actual table, nor even a vague
representation of his data ('bob','joe'?) I assume he isn't designing this
database while still in grade school :)

This type of data would find itself very naturally within a table of data
and is a pretty common thing.

-- 
----------------------------------------------------------------------------
-----------
Louis Davidson (drsql@hotmail.com)
Compass Technology Management
Pro SQL Server 2000 Database Design
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are
interested in consulting services.  All other replies will be ignored :)
"Uri Dimant" <urid@iscar.co.il> wrote in message
news:uc$$INOAEHA.2484@TK2MSFTNGP12.phx.gbl...
> > Bad schema?  What is wrong with the schema?
> He does not define a primary key on the table for instance.
>
>
> "Louis Davidson" <dr_dontspamme_sql@hotmail.com> wrote in message
> news:#6xIsGJAEHA.1464@tk2msftngp13.phx.gbl...
> > Bad schema?  What is wrong with the schema?
> >
> > --
>
> --------------------------------------------------------------------------
> --
> > -----------
> > Louis Davidson (drsql@hotmail.com)
> > Compass Technology Management
> >
> > Pro SQL Server 2000 Database Design
> > http://www.apress.com/book/bookDisplay.html?bID=266
> >
> > Note: Please reply to the newsgroups only unless you are
> > interested in consulting services.  All other replies will be ignored :)
> >
> > "Roji. P. Thomas" <lazydragon@nowhere.com> wrote in message
> > news:%23$pg$VHAEHA.2632@TK2MSFTNGP12.phx.gbl...
> > > I am sorry to say that you have a bad schema.
> > > Anyways to answer your question,
> > > It is possible.
> > >
> > > You need to define a function which returns all the
> > > age_matches columns for a given name as a string.
> > >
> > > Then you can write something like
> > >
> > > Select name, dbo.ufn_agematches(name)
> > > From yourtable
> > > GROUP By name,
> > >
> > >
> > >
> > > --
> > > Roji. P. Thomas
> > > SQL Server Programmer
> > > "sivrik" <anonymous@discussions.microsoft.com> wrote in message
> > > news:44BD7A47-9EE1-4D74-B66D-5BA1ADF7039C@microsoft.com...
> > > > Hey everybody,
> > > >
> > > > I have a table that looks like so:
> > > >
> > > > name     age_matches
> > > > -------------------------
> > > > bob        bob
> > > > bob        phil
> > > > bob        joe
> > > > joe         bob
> > > > joe         rick
> > > >
> > > > I'd like to use a select to make the following table:
> > > >
> > > > name     age_matches
> > > > -------------------------
> > > > bob        bob, phil, joe
> > > > joe         bob, rick
> > > >
> > > > I'd preferably like to do it without using a cursor.  Is this
> possible?
> > > >
> > > > TIA,
> > > > sivrik.
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: Using SQl to store aspx pages and memory problems
    ... I've seen classic ASP applications design this way that work ... database isn't some sort of magic pixie dust that solves all problems. ... > the memory increases - the slowness of the request could be dealt with by ... >> takes to get the page from SQL Server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: multiple cascade paths
    ... You should not have them if your schema is designed properly. ... make you understand that I tried to show that a proper design can have ... am a SQL Server MVP, for crying out loud - you can safely assume that I ...
    (comp.databases.ms-sqlserver)
  • RE: database options with SBS 2003 R2
    ... It was doable for the customer to design their own access database in a peer ... If you don't want to deal with a version of SQL Server for the data, ... end MDB files. ...
    (microsoft.public.windows.server.sbs)
  • Re: Database design question
    ... Pro SQL Server 2000 Database Design ... Please reply to the newsgroups only unless you are ...
    (microsoft.public.sqlserver.programming)
  • Re: A little help with access forms.
    ... This is an upsized database and it does have the upsize_ts field, however, I ... I lay no claim to this "design". ... I didn't say Access, I said .mdb file. ... get my users over to SQL server. ...
    (microsoft.public.access.conversion)