You are here: SQL to combine columns « MsSQL Server « IT news, forums, messages
SQL to combine columns

Posted by Steve London on 03/08/07 21:43

I'm sure this has been brought up many times, but I will ask anyway.

Let's say I have 2 tables related:

Owner:
---------
o_id
o_name

Dog:
---------
d_id
d_name
o_id - for Owner table.

If the data is laid out as

o_id o_name
1 John

d_id d_name o_id
1 Skippy 1
2 Fido 1

How can I make a query that will produce the following results:

o_id o_name owned dog names
1 John Skippy, Fido

I think it has something to do with unions but I can't seem to get it. I'm
using SQL Server Compact Edition.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация