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 |
infodemers
Posting Yak Master
183 Posts |
Posted - 2013-06-18 : 14:29:28
|
Hi ,I wish to create a table that include a distinct list of Office from a table and add to each of them, a row with a value between 0800 to 2300. sor for every single office , I would have 16 records(rows).Office | Hour_____________ABCD 0800ABCD 0900 . . . .ABCD 2300KLMN 0800KLMN 0900 etc... |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2013-06-18 : 14:45:18
|
One way is to create a table (temp or permanent or table var or derived or cte) with your 16 rows. Then CROSS JOIN that in a select statement to your Office table. That would result in 16 rows for every office.Be One with the OptimizerTG |
|
|
infodemers
Posting Yak Master
183 Posts |
Posted - 2013-06-18 : 16:10:25
|
I thank you very much, that did the trick using temp table! :-) |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2013-06-18 : 16:34:44
|
You're welcome! - thanks for the update.Be One with the OptimizerTG |
|
|
|
|
|