Solved

SQL VIEW

Posted on 2012-12-20
2
279 Views
Last Modified: 2012-12-20
Hello to All SQL Gurus,
Got a SQL server table that has just two columns - Amt1 and Amt2. Need to create a VIEW of this existing table like so that we have three more extra columns in addition to the amt1,amt2…..that gets created on fly…like
AdjustedRaw (Amt1+ Amt2)
AdjustedIN ((Amt1+ Amt2)*0.68)
AdjustedPut (Amt1+ Amt2)*0.2)

VIEW like this below:
Amt_1      Amt_2      AdjustedRaw      AdjustedIN      AdjustedOUT

So what the SQL server code to create this view?
0
Comment
Question by:Rayne
2 Comments
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 38709819
create view my_view
as

select
amt_1,
amt_2,
Amt1+ Amt2 as AdjustedRaw,
((Amt1+ Amt2)*0.68) as AdjustedIN,
(Amt1+ Amt2)*0.2) as AdjustedPut
from table
0
 

Author Closing Comment

by:Rayne
ID: 38709840
thanks GED325 :)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now