用case when 慢慢寫(xiě)

創(chuàng)新互聯(lián)是一家專(zhuān)注于網(wǎng)站設(shè)計(jì)、網(wǎng)站制作與策劃設(shè)計(jì),仙桃網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專(zhuān)注于網(wǎng)站建設(shè)十多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專(zhuān)業(yè)建站公司;建站業(yè)務(wù)涵蓋:仙桃等地區(qū)。仙桃做網(wǎng)站價(jià)格咨詢(xún):028-86922220
'1110630' +
case b.wdh when '00' then '0201'
when '02' then '0301'
when '03' then '0401'
...
else '0101' end
+ '00000000' as P005
DECLARE @str as nVARCHAR(max)
set @str='yyq,'
select @str=@str+''''+fkmc+''''+'=sum(case fkmc when
'+''''+fkmc+''''+' then fk else null end),'
from hb group by fkmc
set @str='select '+substring(@str,1,len(@str)-1)+',sum(fk) as 合計(jì) from hb group by yyq'
print @str
exec(@str)
你這樣寫(xiě),我執(zhí)行了一下是可以的,除了數(shù)據(jù)為空時(shí),其他都可以的
International logistics has become an important part of economic system. Modern logistics is the result of economic globalization, but also promote the economic globalization is an important services. Logistics enterprise to improve the competitiveness of enterprise informatization construction, there is the road. Modern logistics management system including single business management, scheduling up business management, transportation business management, inventory management, personnel management. Business management and operation in the whole logistics management system in control.
In business for scheduling, inventory management workload big technical problems, we design and implement inventory management system. This system is running on Windows platforms, using J2EE platform development, with high throughput and scalability of the system, the system can adapt to a larger scale of operations and future development. And in the business can provide complex function at the same time, still can provide simple and intuitive operating mode and the page.
The main content of this article for:
First, introduces the research background, and modern logistics system, analyses the development status of modern logistics system of inventory management system.
Second, introduces MVC design patterns, currently using frame of Struts J2EE technology and SQL Server database in the use and development of 2005.
Third, according to the pattern design, design MVC dispatching business module of inventory management subsystem,
Fourth, using J2EE technology and SQL Server 2005 database, realizes the inventory management subsystem according to the following functions: single information retrieval outbound request form, According to the state Treasury information retrieval request list, According to the state information retrieval transport request list, Searching out the corresponding information warehouse inventory goods, The outbound transportation and request for review.
Added:
This system USES B/S model design, use Java, JavaScript as the application development, using the language Sqlserver005 create backstage database, making use of graphics software Visio state chart and control flow graph and Jtest use of unit tests, using open-source Bug management tools mantis, submit the related Bug finally formed through the test data, to test for business process.
加入sql2005的jar包 ;displaylang=zh-cn 下載
在看數(shù)據(jù)庫(kù)用戶(hù)名和密碼是否正確
你試試把下載數(shù)據(jù)庫(kù)驅(qū)動(dòng)包下的一個(gè).dll文件放在windows目錄下的system32還是system下面試試 我以前遇到過(guò)這樣的問(wèn)題
那你最好分開(kāi)寫(xiě),一個(gè)SQL查詢(xún)不為1的,一個(gè)SQL查詢(xún)?yōu)?的,然后Union起來(lái)
網(wǎng)站名稱(chēng):sqlserver005,SQLserver2005
URL地址:http://chinadenli.net/article42/dsgdjec.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、網(wǎng)站內(nèi)鏈、軟件開(kāi)發(fā)、全網(wǎng)營(yíng)銷(xiāo)推廣、手機(jī)網(wǎng)站建設(shè)、虛擬主機(jī)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)