Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-07-29 : 21:36:47
|
Bruno writes "HiI have the need of something to replace the FUNCTION existing in Oracle and SQLServer 2000. I'm running SQLServer 7 and cannot have functions (which would solve my problem very easily).Is there any way of using procedures, cursors or subqueries to perform this simple task below???? Please help me out.drop table tbl1drop table tbl2create table tbl1 ( id smallint, name varchar(20), address varchar(30) )create table tbl2 ( id smallint, text varchar(20) )insert into tbl1 values(1,'name1', 'address1')insert into tbl1 values(2,'name2', 'address2')insert into tbl1 values(3,'name3', 'address3')insert into tbl2 values(1,'text1a')insert into tbl2 values(1,'text1b')insert into tbl2 values(1,'text1c')insert into tbl2 values(2,'text2a')insert into tbl2 values(2,'text2b')***** this is the result I wantname address text ------- ------------------------------ --------------------------name1 address1 text1a, text1b, text1cname2 address2 text2a, text2a(2 row(s) affected) ***** this is the result I can getselect tbl1.name,tbl1.address,tbl2.text from tbl1, tbl2 where tbl1.id=tbl2.idname address text ------- ------------------------------ -------------------- name1 address1 text1aname1 address1 text1bname1 address1 text1cname2 address2 text2aname2 address2 text2b(5 row(s) affected) " |
|
|
|
|
|
|
|