![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
If I have table1 and table2 with table2 having multiple rows tied to a single row in table 1. What I am trying to do is set up a view that has one row that shows the following table1.uniqueid, table1.name, table2.row1.detail, table2.row2.detail, table2.row3.detail I'd like to be able to do a select on the view and only come back with one row per widget. If possible, I'd actually like to be able to concat all the rows from table 2 into one column if that's possible. table1.uniqueid, table1.name, (table2.row1.detail - table2.row2.detail - table2.row3.detail), table1.dateCreated |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
found a really good alternative on sqlteam.com USE Northwind GO CREATE FUNCTION dbo.ConcatOrderProducts(@OrderID int) RETURNS VARCHAR(8000) AS BEGIN DECLARE @Output VARCHAR(8000) SELECT @Output = COALESCE(@Output+', ', '') + CONVERT(varchar(20), P.ProductName) |
![]() |
| Thread Tools | |
| Display Modes | |
| |