Is it possible to write a database view that encompasses one-to-many relationships?

Posted by Brandon Linton on Stack Overflow See other posts from Stack Overflow or by Brandon Linton
Published on 2010-06-16T16:12:15Z Indexed on 2010/06/16 16:22 UTC
Read the original article Hit count: 229

So I'm not necessarily saying this is even a good idea if it were possible, since the schema of the view would be extremely volatile, but is there any way to represent a has-many relationship in a single view?

For example, let's say I have a customer that can have any number of addresses in the database. Is there any way to list out each column of each address with perhaps a number as a part of the alias (e.g., columns like Customer Id, Name, Address_Street_1, Address_Street_2, etc)?

Thanks!

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about database