Click here to Skip to main content
15,899,679 members
Home / Discussions / Database
   

Database

 
GeneralSQL Server Setup Pin
fume12-Sep-03 15:21
fume12-Sep-03 15:21 
GeneralRe: SQL Server Setup Pin
Mike Epprecht13-Sep-03 5:39
Mike Epprecht13-Sep-03 5:39 
GeneralRe: SQL Server Setup Pin
Rob Graham15-Sep-03 10:10
Rob Graham15-Sep-03 10:10 
GeneralTrouble removing deleted rows... Pin
james-cxx12-Sep-03 12:59
james-cxx12-Sep-03 12:59 
GeneralRe: Trouble removing deleted rows... Pin
Rob Graham15-Sep-03 10:41
Rob Graham15-Sep-03 10:41 
GeneralRe: Trouble removing deleted rows... Pin
james-cxx16-Sep-03 8:11
james-cxx16-Sep-03 8:11 
Generalhelp, please! Pin
yyf12-Sep-03 8:13
yyf12-Sep-03 8:13 
GeneralVSS Pin
yyf12-Sep-03 8:07
yyf12-Sep-03 8:07 
GeneralRe: VSS Pin
Tom Archer12-Sep-03 10:17
Tom Archer12-Sep-03 10:17 
GeneralRe: VSS Pin
yyf12-Sep-03 11:03
yyf12-Sep-03 11:03 
GeneralRe: VSS Pin
Tom Archer12-Sep-03 11:14
Tom Archer12-Sep-03 11:14 
GeneralRe: VSS Pin
Michael P Butler15-Sep-03 10:35
Michael P Butler15-Sep-03 10:35 
GeneralFill Missing Dates in Query for Reporting Pin
Roland Bär12-Sep-03 4:22
Roland Bär12-Sep-03 4:22 
GeneralDatatAdapter Update method and Transactions question Pin
Risbom12-Sep-03 1:57
Risbom12-Sep-03 1:57 
GeneralGetting SQL Server to generate code for objects Pin
OMalleyW11-Sep-03 4:51
OMalleyW11-Sep-03 4:51 
GeneralShrinkwrap database deployment Pin
Michael P Butler11-Sep-03 2:18
Michael P Butler11-Sep-03 2:18 
GeneralRe: Shrinkwrap database deployment Pin
Rob Graham15-Sep-03 10:06
Rob Graham15-Sep-03 10:06 
GeneralRe: Shrinkwrap database deployment Pin
Michael P Butler15-Sep-03 10:13
Michael P Butler15-Sep-03 10:13 
GeneralRe: Shrinkwrap database deployment Pin
Steve S15-Sep-03 21:55
Steve S15-Sep-03 21:55 
GeneralConcat Strings SQL Questions Pin
Braulio Dez10-Sep-03 23:21
Braulio Dez10-Sep-03 23:21 
GeneralRe: Concat Strings SQL Questions Pin
Mike Dimmick12-Sep-03 2:06
Mike Dimmick12-Sep-03 2:06 
GeneralRe: Concat Strings SQL Questions Pin
Braulio Dez12-Sep-03 2:18
Braulio Dez12-Sep-03 2:18 
Hi,

I found a solution with SQL Server, a bit ugly T-SQL thing...

<br />
CREATE TABLE foo<br />
 (c1 VARCHAR(10) NOT NULL, c2 VARCHAR(10) NOT NULL CHECK (c2 NOT LIKE<br />
'%,%'), PRIMARY KEY (c1,c2) )<br />
<br />
INSERT INTO foo VALUES ('Tom','Car')<br />
INSERT INTO foo VALUES ('Tom','House')<br />
INSERT INTO foo VALUES ('Tom','Plane')<br />
INSERT INTO foo VALUES ('Tom','Boat')<br />
INSERT INTO foo VALUES ('Jim','House')<br />
INSERT INTO foo VALUES ('Jim','Boat')<br />
<br />
CREATE TABLE Results<br />
 (c1 VARCHAR(10) PRIMARY KEY, c2list VARCHAR(100) NOT NULL)<br />
<br />
INSERT INTO Results<br />
 SELECT c1,MAX(c2) FROM foo GROUP BY c1<br />
<br />
WHILE @@ROWCOUNT>0<br />
 UPDATE Results<br />
  SET c2list =<br />
  (SELECT MAX(c2)<br />
   FROM foo<br />
   WHERE foo.c1 = Results.c1 AND<br />
    foo.c2<LEFT(c2list,CHARINDEX(',',c2list+',')-1))<br />
   + ', ' + c2list<br />
  WHERE EXISTS<br />
  (SELECT *<br />
   FROM foo<br />
   WHERE foo.c1 = Results.c1 AND<br />
    foo.c2<LEFT(c2list,CHARINDEX(',',c2list+',')-1))<br />
<br />
SELECT * FROM Results<br />
<br />

QuestionSQL: How to create a 1:1 relation? Pin
King_of_Queens10-Sep-03 22:09
King_of_Queens10-Sep-03 22:09 
AnswerRe: SQL: How to create a 1:1 relation? Pin
Mike Dimmick12-Sep-03 0:51
Mike Dimmick12-Sep-03 0:51 
Generaldatabase Pin
ranjjj10-Sep-03 19:01
ranjjj10-Sep-03 19:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.