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 |
|
JennyCullen
Starting Member
2 Posts |
Posted - 2003-04-14 : 05:31:25
|
| Someone help please I'm joinging one table to another but I want to manipulate a column in one of the tables.Can I do this this will creating the view ?Similarly, Is it possible to add a column to a view while joining two tables together ?ThanxJenny |
|
|
Peter Dutch
Posting Yak Master
127 Posts |
Posted - 2003-04-14 : 07:38:30
|
| http://www.aspmessageboard.com/forum/databases.asp?M=572443&F=21&P=1 |
 |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2003-04-14 : 09:15:51
|
| Jenny, what do you mean when you say "I want to manipulate a column"? If you mean you want to format it in some way (for example, displaying only part of a string), yes you can. And yes, you can add a column to a view, with a static value or a value based on calculations or other operations on other columns in the base tables used in the view.OS |
 |
|
|
JennyCullen
Starting Member
2 Posts |
Posted - 2003-04-14 : 20:04:34
|
| Mohdowais,I don't need to format the column in any way, I just need to set it to zero.Do you have any sample code of how to do this or how to add a static column ?ThanxJennyPS. Peter you're a genius..... |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-04-14 : 20:17:37
|
| If you just want one of the columns to be 0, then how about this:CREATE VIEW v_SomeViewASSELECT t1.Column1, t1.Column2, 0 AS Zero, t1.Column4FROM Table1 t1INNER JOIN Table2 t2 ON t1.Column1 = t2.Column1GOTara |
 |
|
|
|
|
|