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 |
|
richardlaw
Yak Posting Veteran
68 Posts |
Posted - 2010-10-02 : 08:24:28
|
| HiI have to tables, one for competitions dates, and one for other events. Both have similar data, but not all the same.What I'd like to do is create a view that merges the two, so that I have one column for date, and one column for event title.Does this make sense? Currently, I can create a view with 2 sets of titles and 2 dates - one value for each depending on which table it originally came from, but I need only one title, and one date.Any help would be much appreciated.ThanksRichard |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-10-02 : 08:41:42
|
| [code]CREATE VIEW vw_EventsASSELECT <Title Column>, Date FROM <Competition Table>UNIONSELECT <Title Column>, Date FROM <Other Event Table>[/code]Do you need any thing else ?Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
|
richardlaw
Yak Posting Veteran
68 Posts |
Posted - 2010-10-02 : 10:16:55
|
quote:
SELECT <Title Column>, Date FROM <Competition Table>UNIONSELECT <Title Column>, Date FROM <Other Event Table>
This looks to work perfectly - many thanksRichard |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-10-02 : 10:39:32
|
Welcome Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
|
|
|
|
|
|