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
484
2.9k
196k
If is null then 0
Sep 2 2018 7:48 AM
Code working fine, just need to replace last line 6 to be:
IF IS null then 0
Some help
select
x1.naziv, x1.Nabavka, x2.Prodaja, x1.Nabavka-x2.Prodaja
as
'Stanje'
from
(
select
naziv,
sum
(kolicina)
as
Nabavka
from
(
select
naziv
as
naziv,
convert
(
float
, kolicina)
as
kolicina
from
ulazni_racun_roba_roba
union
all
select
naziv
as
naziv,
convert
(
float
, kolicina)
as
kolicina
from
mp_ulazni_racun_ostalo_roba ) a
group
by
naziv) x1
left
join
(
select
roba,
sum
(kolicina)
as
Prodaja
from
(
select
roba,
convert
(
float
, kolicina)
as
kolicina
from
mp_racun_roba
union
all
select
roba,
convert
(
float
, kolicina)
as
kolicina
from
mp_faktura_roba ) b
group
by
roba ) x2
on
x1.naziv = x2.roba
where
x2.roba
is
not
null
Reply
Answers (
2
)
select 100 questions at a time of 5 different subjects
fuction to split by comma from a string