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
SQL Create Multiple Column from Multiple Tables
Jul 27 2018 10:40 AM
SQL SERVER 2017
Some help
Error is line 4
I need first column Naziv artikla (Line 1)
second column Prodata Kolicina (Line 2)
Third column Nabaljena kolicina (Line 4) some error
Fourth column difference Line4 - Line 2 as Ukupno
SELECT roba as
'Naziv artikla'
,
SUM (cast(kolicina as
float
)) as
'Prodata kolicina'
from (select roba, kolicina from mp_racun_roba
union
all select roba, kolicina from mp_faktura_roba) as alltables
INNER JOIN mp_ulazni_racun_ostalo_roba ON alltables.kolicina=mp_ulazni_racun_ostalo_roba.kolicina as
'Nabavljena kolicina'
--SUM COLUMN
'Nabavljena kolicina'
-
'Prodata kolicina'
//result column
group by roba
Reply
Answers (
7
)
import table to a new database
to import excel file into mysql