🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.bazy-danych
Article #195241

Re: [MSSQL] Zagnieżdżony SELECT i NULL

#195241
From: Adam
Date: Sat, 18 Feb 2017 09:01
23 lines
1336 bytes
W dniu 2017-02-18 o 08:54, geos pisze:
> On 18.02.2017 00:28, Adam wrote:
>> select T_Kod, T_Nazwa,
>>     (select SUM(D_Ilosc) from #tmpDostawa where D_Kod = T_Kod)
>>     from #tmpTowar
>
> coalesce:
>
> select t_kod, t_nazwa,
>     (select coalesce(sum(d_ilosc),0) from #tmpdostawa where d_kod = t_kod)
>     from #tmpTowar
>
> pozdrawiam,
> geos


Dzięki :)


-- 
Pozdrawiam.

Adam
Technical Details
Message-ID: <o892i4$uou$1@usenet.news.interia.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.interia.pl!not-for-mail
References: <o880vb$r5l$1@usenet.news.interia.pl> <58a7fdba$0$15204$65785112@news.neostrada.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.interia.pl!not-for-mail
From: Adam <a.g@poczta.onet.pl>
Newsgroups: pl.comp.bazy-danych
Subject: Re: [MSSQL] Zagnieżdżony SELECT i NULL
Date: Sat, 18 Feb 2017 10:01:55 +0100
Organization: INTERIA.PL S.A.
Lines: 23
Message-ID: <o892i4$uou$1@usenet.news.interia.pl>
References: <o880vb$r5l$1@usenet.news.interia.pl> <58a7fdba$0$15204$65785112@news.neostrada.pl>
NNTP-Posting-Host: ent22.internetdsl.tpnet.pl
Mime-Version: 1.0
X-Trace: usenet.news.interia.pl 1487408516 31518 83.15.205.22 (18 Feb 2017 09:01:56 GMT)
X-Complaints-To: usenet@firma.interia.pl
NNTP-Posting-Date: Sat, 18 Feb 2017 09:01:56 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
In-Reply-To: <58a7fdba$0$15204$65785112@news.neostrada.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit