Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL VIEW

Posted on 2012-12-20
2
Medium Priority
?
324 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Accepted Solution

by:
Kyle Abrahams earned 2000 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

650 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