Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 query issue (syntax)

Author  Topic 

dervis
Starting Member

2 Posts

Posted - 2014-09-18 : 03:32:20
Hi friends, i have a problem on my query,i'm learning sql ,but i have probably syntax error,help me,thank you,have a nice day


Select STOK_KODU ( Select SUM(STHAR_GCMIK) as TOPLAMGIRIS From TBLSTHAR Where STHAR_GCKOD='G'),
( Select SUM(STHAR_GCMIK) as TOPLAMCIKIS From TBLSTHAR Where STHAR_GCKOD='C')


dede

Arun Babu N
Starting Member

26 Posts

Posted - 2014-09-18 : 04:55:11
Select STOK_KODU
from
( Select STOK_KODU,SUM(STHAR_GCMIK) as TOPLAMGIRIS
From TBLSTHAR Where STHAR_GCKOD='G'
group by STOK_KODU ) as tmp,
( Select SUM(STHAR_GCMIK) as TOPLAMCIKIS From TBLSTHAR Where STHAR_GCKOD='C') tmp1



arunbabu
Go to Top of Page
   

- Advertisement -