Title: RE: SqlSever 2000 question

But, that's not normal :)

I can't think of a way to do that with standard SQL, however in transact sql (which is SQL on SqlServer) you do have flow control and cursors and string functions.  However, cursors with SqlServer are really slow.  Only use them after you have selected the records you want to use into a temporary table i.e.,

select c1, c2, c3 into #tempTableName from .... where ...
the # in the table name makes it a temporary table - it will go away when the session ends.



hth,
Chris



-----Original Message-----
To: Multiple recipients of list ORACLE-L
Sent: 11/28/2001 10:30 AM

Hi All,

Sorry for OT but I am very new(few hours) to sql server and need help
with
constructing a query.

I have 2 tables

Table1     Table2
id             id
name,       county
state

There is 1 -> many from table1 to table2
I want to retrieve each record in table1 along with all the counties in
table2 for that ID in one record
For ex.   1,SmithJ,TN,county1 | county2 | county3 | countyN

Any ideas,

Thanks
Rick
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Cale, Rick T (Richard)
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to