Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Comparing Computed columns


Comparing Computed columns

Author
Message
rajkiran-331110
rajkiran-331110
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 153
Hello,
I have got 2computed columns.

select * from table followed by condition as memotype1
I want to pick up my memovalue1 based on memotype1

When i did select * from where memotype=memotype1 ,it is not picking the value.

how can i compare a computed column to populate another computed column
HanShi
HanShi
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3274 Visits: 3644
It's a bit hard to understand your question. Can you post the complete query?

You can try to use the computed phrase to fill your column:

For instance if your computed column is like:
SELECT (Column1 + Column2) * 3 AS Computed
FROM table

instead of using this to fill another table
UPDATE table2
SET ColumnA = Computed
FROM table2 INNER JOIN table ON table1.ID = table2.ID
WHERE ...

you can use this to fill another table:
UPDATE table2
SET ColumnA = (table2.Column1 + table2.Column2) * 3
FROM table2 INNER JOIN table ON table1.ID = table2.ID
WHERE ...

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search