Re: string from column value
From: Louis Davidson (dr_dontspamme_sql_at_hotmail.com)
Date: 03/03/04
- Next message: Erland Sommarskog: "Re: Funky Error"
- Previous message: Patrice: "My guess is stored procedures"
- In reply to: Uri Dimant: "Re: string from column value"
- Next in thread: Roji. P. Thomas: "Re: string from column value"
- Messages sorted by: [ date ] [ thread ]
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. > > > > > > > > > > > >
- Next message: Erland Sommarskog: "Re: Funky Error"
- Previous message: Patrice: "My guess is stored procedures"
- In reply to: Uri Dimant: "Re: string from column value"
- Next in thread: Roji. P. Thomas: "Re: string from column value"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|