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
Goran Bibic
482
2.9k
197.7k
select value from row-1 MS SQL from multiple table
Apr 16 2020 7:00 AM
https://www.c-sharpcorner.com/forums/select-value-from-row1-ms-sql
Solution from one table work...from multiple tables?
with
cte
as
(
select
iznos_sa_porezom
as
'Duguje'
,
'0.00'
as
'Potražuje'
,
ROW_NUMBER() OVER (
ORDER
BY
(
SELECT
NULL
))
AS
RN
from
dbo.mp_ulazni_racun_roba_lista
where
redni_broj
IS
NOT
NULL
group
by
iznos_sa_porezom
union
all
select
iznos_sa_porezom
as
'Duguje'
,
'0.00'
as
'Potražuje'
,
ROW_NUMBER() OVER (
ORDER
BY
(
SELECT
NULL
))
AS
RN
from
dbo.mp_ulazni_racun_ostalo_lista
where
redni_broj
IS
NOT
NULL
group
by
iznos_sa_porezom)
select
[Duguje], [Potražuje],
(
SELECT
sum
(Duguje-Potražuje)
FROM
cte t2
WHERE
t2.RN <= cte.RN)
AS
Saldo
from
cte
Reply
Answers (
1
)
Get difference of salary row by row ?
Datagridview problem when form load