Solved

SQL VIEW

Posted on 2012-12-20
2
296 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

809 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