Solved

SQL VIEW

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

829 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