TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abdu Rafeeq
NA
113
264.1k
How to assign a variable in select statement
May 17 2011 3:55 AM
I have Some filedvalues say OpeningWt,SalesDetails and Balance fro differwnt table
select
opWt.OpeningWt as OpeningWt,
sales.SalesDetails as SalesDetails ,
opWt.OpeningWt-sale.SalesDetails as Balance
from sales inner join opWt on opWt.id=sales .id
This is sample query for selecting values.
I got balance , this balance assign to openingwt for next row
How assign in select statement
this type of answer i required
OpenigWt SalesDetails Balance
0 5 5
5 8 -3
-3 9 -12
I think any loop can use? i dont know how to use.. pls help me
Reply
Answers (
3
)
update existing data format
Insert Data in temparary Table Throw execute Sp inside sp