Pl/sql ±à³ÌÖ®case whenµÄÓ÷¨
Pl/sql ±à³ÌÖ®case whenµÄÓ÷¨£º£¨t3.LOCAL_BF_KND='111000' -- ±¾Ô»ù±¾ÔÂ×â·Ñ£©
select sum(t1.FAV_FEE) from bi_rw.FO_A_2FAV_M_G t1, bi_rw.D_BILLFEE_KND t3 where t1.BILLFEE_KND=t3.BILLFEE_KND(+) and t3.LOCAL_BF_KND='111000' --1310557.76
Èç¹û²»±ãÓÚ°ÑÌõ¼þt3.LOCAL_BF_KND='111000' дÔÚwhereÌõ¼þÖУ¬ÔòÐèҪʹÓÃcase when ÓïÑÔÀ´ÏÞ¶¨Ìõ¼þ£º
select sum(case when t3.LOCAL_BF_KND='111000' then t1.FAV_FEE else 0 end ) from bi_rw.FO_A_2FAV_M_G t1, bi_rw.D_BILLFEE_KND t3
where t1.BILLFEE_KND = t3.BILLFEE_KND(+) --1310557.76
Ïà¹ØÎĵµ£º
SQL ServerÖе÷Ó÷½·¨Ê±£¬¾³£Óöµ½.»òÊÇ::Á½ÖÖµ÷Ó÷½·¨£¬ÆäÖÐ. ÊÇʵÀýµ÷Ó÷½·¨£¬::ÊǾ²Ì¬µ÷Ó÷½·¨¡£Èç¹û´ó¼Ò¶ÔC#Óï·¨ÊìϤµÄ»°£¬. ¶ÔÓ¦C#Öе÷ÓÃʵÀý·½·¨£¬:: ¶ÔÓ¦C#ÖеÄstatic·½·¨¡£
ÏÂÃæ¸ø³öÒ»¸öSQL ServerµÄʵÀý£¬ÏÂÃæµÄSQLÔËÐÐÔÚ2008»·¾³Ï£º
DECLARE @g geography;
SET @g = geography::Parse('LINESTRING(-122.360 ......
ËøµÄ¸ÅÊö ¡¡¡¡Ò». ΪʲôҪÒýÈëËø
¡¡¡¡¶à¸öÓû§Í¬Ê±¶ÔÊý¾Ý¿âµÄ²¢·¢²Ù×÷ʱ»á´øÀ´ÒÔÏÂÊý¾Ý²»Ò»ÖµÄÎÊÌ⣺
¡¡¡¡¶ªÊ§¸üÐÂ
¡¡¡¡A£¬BÁ½¸öÓû§¶ÁͬһÊý¾Ý²¢½øÐÐÐ޸ģ¬ÆäÖÐÒ»¸öÓû§µÄÐ޸Ľá¹ûÆÆ»µÁËÁíÒ»¸öÐ޸ĵĽá¹û£¬±ÈÈ綩Ʊϵͳ
¡¡¡¡Ôà¶Á
¡¡¡¡AÓû§ÐÞ¸ÄÁËÊý¾Ý£¬ËæºóBÓû§ÓÖ¶Á³ö¸ÃÊý¾Ý£¬µ«AÓû§ÒòΪijЩÔÒòÈ¡ÏûÁ˶ÔÊý¾ ......
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE data ......
Õª×Ô£ºhttp://livenzhao.spaces.live.com/blog/cns!6E368BE9F6DDD872!595.entry
·PL/SQL DeveloperʹÓü¼ÇÉ
1¡¢PL/SQL Developer¼ÇסµÇ½ÃÜÂë
ÔÚʹÓÃPL/SQL Developerʱ£¬ÎªÁ˹¤×÷·½±ãÏ£ÍûPL/SQL Developer¼ÇסµÇ¼OracleµÄÓû§ÃûºÍÃÜÂ룻
ÉèÖ÷½·¨£ºPL/SQL Developer 7.1.2 ->tools->Preferences-> ......
ÔÚ½øÐÐÊý¾Ý¿â²éѯʱ£¬ÓÐÍêÕû²éѯºÍÄ£ºý²éѯ֮·Ö¡£
Ò»°ãÄ£ºý²éѯÓï¾äÈçÏ£º
SELECT ×ֶΠfrom ±í WHERE ij×ֶΠLike Ìõ¼þ
ÆäÖйØÓÚÌõ¼þ£¬SQLÌṩÁËËÄÖÖÆ¥Åäģʽ£º
1£¬%
£º±íʾÈÎÒâ0¸ö»ò¶à¸ö×Ö·û¡£¿ÉÆ¥ÅäÈÎÒâÀàÐͺͳ¤¶ÈµÄ×Ö·û£¬ÓÐЩÇé¿öÏÂÈôÊÇÖÐÎÄ£¬ÇëʹÓÃÁ½¸ö°Ù·ÖºÅ£¨%%£©±íʾ¡£
±ÈÈç SELECT * from [user] WHERE u_na ......