Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÔÚsql2000ÖвâÊÔͨ¹ý,µ«ÔÚaccess²»ÄÜͨ¹ýµÄsqlÓï¾ä

select WorkerID,SUM(CASE WHEN WorkType='°´Ê±Ï°à' THEN  1 ELSE 0 END) AS a from CheckWorker where WorkerID=17 GROUP BY WorkerID

Õâ¸öÓï¾äÔÚaccessÖÐÌáʾ"Óï·¨´íÎó(²Ù×÷·û¶ªÊ§)ÔÚ²éѯ±í´ïʽ'SUM(CASE WHEN WorkType='°´Ê±Ï°à' THEN  1 ELSE 0 END)'ÖÐ
ÔÚsql2000²éѯ·ÖÎöÆ÷ÖвâÊÔÊÇͨ¹ýµÄ
ºÜ¼±Ñ½,лл!
ÒýÓÃ
select WorkerID,SUM(CASE WHEN WorkType='°´Ê±Ï°à' THEN  1 ELSE 0 END) AS a from CheckWorker where WorkerID=17 GROUP BY WorkerID

Õâ¸öÓï¾äÔÚaccessÖÐÌáʾ"Óï·¨´íÎó(²Ù×÷·û¶ªÊ§)ÔÚ²éѯ±í´ïʽ'SUM(CASE WHEN WorkType='°´Ê±Ï°à' THEN  1 ELSE 0 END)'ÖÐ
ÔÚsql2000²éѯ·ÖÎöÆ÷ÖвâÊÔÊÇͨ¹ýµÄ
ºÜ¼±Ñ½,лл!



ÊÔÊÔ
SQL code:

select WorkerID,SUM(CASE [WorkType] WHEN '°´Ê±Ï°à' THEN 1 ELSE 0 END) AS a from CheckWorker where WorkerID=17 GROUP BY WorkerID


»¹ÓÐÄãµÄACCESSÖ§³Ö case Óï¾äÂð?


Ôõô֪µÀaccessÖ§³Ö²»Ö§³ÖcaseÓï¾ä?

ÄãµÄÓï¾äÎÒÊÔ¹ýÁË£¬»¹ÊÇÒ»ÑùµÄ´íÎó
¹À¼ÆÊÇÒòΪaeecss²»Ö§³ÖcaseÓï¾ä,ÄÜÓÃʲô´úÌæcaseÓï¾ä,ʵÏÖÎÒÒªµÄ½á¹ûÂð?

CASE WHEN WorkType='°´Ê±Ï°à' THEN  1 ELSE 0 END
-------------->
iif(WorkType='°´Ê±Ï°à',1,0)

ÕâÑùÊÔÒ»ÏÂ

·¹ýѧϰÏ¡£


лл´ó¼Ò
Î


Ïà¹ØÎÊ´ð£º

access ÖÐÖ´ÐÐsqlÓï¾äupdate²»³É¹¦£¬ÇóÖú£¡£¡£¡

access ÖÐÖ´ÐÐsql updateÓï¾äʱÓÐʱºò³É¹¦ÓÐʱºò²»³É¹¦£¬µ«ÊÇaccessÖв»³ö´íÎóÐÅÏ¢£¬²»ÖªµÀÊÇʲôԭÒò£¬ÓÐÄÄλ´óÏÀÖªµÀ£¬Çë°ïæ°¡
ÌùSQLÓï¾ä£¬¼ì²é±í¡¢×ֶεÄÓÐЧÐÔÉèÖÃ

sql ÔÚ²éѯ·ÖÎöÆ÷ÀïÃæ Ö´ÐкÜÕý³£

ÊÇ ......

ÔÚsqlÖÐʹÓÃoutputºÍ²»Ê¹ÓõÄÇø±ð£¿

ÔÚsqlÖÐʹÓÃoutputºÍ²»Ê¹ÓõÄÇø±ð£¿
ÀýÈ磺
ALTER PROCEDURE [dbo].[sp_1]
@SYS_LNNO varchar(20),
@SYS_CALLER varchar(20),
        @SYS_ORGANIZE varchar(10), ......

ʹÓÃRepeater¶ÁÈ¡access±í£¬Ò³Ãæ´ò¿ª·Ç³£Âý

accessÊý¾Ý¿â£¬Ö±½ÓʹÓà select ×ֶΠfrom ±í  ¶ÁÈ¡Êý¾Ý
È»ºóÔÚÒ³ÃæÖÐʹÓÃRepeaterÀ´ÏÔʾ
ÕâÕűíÓÐ2000ÌõÊý¾Ý£¬ËùÒÔÒ³Ãæ´ò¿ªµÄºÜÂý
Çë½Ì¸÷λÅóÓÑ£¬ÓÐûÓа취½â¾ö£¬Ìá¸ßµãËٶȣ¡
Ò»´ÎÈ«²¿¶ÁÍê ......

ACCESSµÄ×Ô¶¨Ò庯ÊýÔÚdelphiÀïÔõôÓÃÄØ...

ÎÒÔÚÄ£¿éÀï×Ô¶¨ÒåÁËÒ»¸öº¯Êý:stradd()

¿ÉÊÇÔÚadoquery1.sql.add('select stradd(author) from book');
ʱÌáʾstradd䶨Òå...

Õâ¸öÎÊÌâÓÐʲô°ì·¨¿ÉÒÔ½â¾öµÄÂð? ·Ç³£¸Ð¼¤!


(ÔÚA ......

´íÎóÐÅÏ¢Access violation....

ÕâÁ½Ììѧϰ¡¶Delphi¼¼Êõ·½°¸±¦µä¡·Ò»ÊéÖеÚÈýÕ¹ØÓÚÓû§µÇ¼·½°¸µÄÀý×Ó£¬ÀûÓõÄÊÇSQl ServerÊý¾Ý¿âʵÏÖÓû§µÇ¼£¬±àÒëÔËÐж¼Ã»ÎÊÌ⣬¸ÃʵÏֵŦÄÜÒ²¶¼ÊµÏֵĺܺ㬵«ÊÇÆæ¹ÖµÄÊÇ£¬·´¸´ÔËÐÐÒ»¶Îʱ¼äºó£¬ÓÐʱÔڹرÕÕû¸ö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ