2¸ösql Äܹ»ÔÚmysqlÀïºÏ²¢³ÉÒ»¸ösqlÂð
Õâ¸ösqlÈçºÎÓÅ»¯
µ±Ç°ÊÇÕâÑù½â¾öÎÊÌâµÄ
select * from
(
select b.name, count(a.eid) from (select eId,uId from S where status=1and curdate>='2009-06-01' and
curdate <'2009-07-01' group by eId)a , User b where a.uId=b.id group by a.uId
union all
select null, count(*) from (select eId,uId from S where status=1and curdate>='2009-06-01' and
curdate <'2009-07-01' group by eId)a , User b where a.uId=b.id
)c
order by od
)
ÉÏÃæµÄsql¹¦ÄÜÊÇ·Ö×éͳ¼ÆÃ¿¸öÔµÄeId²¢×îºóÇósum£¬ÕâÀï select null, count(*) from (select eId,uId from S where status=1and curdate>='2009-06-01' and
curdate <'2009-07-01' group by eId)a , User b where a.uId=b.id
)c
order by od
½ö½öÊÇΪÁËͳ¼ÆÇ°Ãæ·Ö×éͳ¼ÆµÄ£¨union all֮ǰµÄsql£©·Ö×éµÄcountµÄsum¡£
˼¿¼ Õâ2¸ösql Äܹ»ÔÚmysqlÀïºÏ²¢³ÉÒ»¸ösqlÂ𣿣¿ £¨Ò²¾ÍÊDz»ÓÃunion all£©
ÎÒÓÃjavaд´úÂëʵÏÖÁË
Ïà¹ØÎÊ´ð£º
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
ÇëÎÊһϣ¬ÍâÍøÁ½Ì¨SQLSERVERʵÀýÊý¾Ý´«Ê䣬ÓÐûÓвÉÓÃÊý¾ÝѹËõºÍ¼ÓÃÜ¡£Ñ¹Ëõ±ÈÊǶàÉÙ£¬¼ÓÃÜÊÇʲô¼ÓÃÜËã·¨£¿Ïà¹ØÎĵµÄÄÀï¿ÉÒÔÕÒµ½£¿Ð»Ð»
ÎÒÒ²ÏëÖªµÀ£¡¹Ø×¢´ËÌù£¡
¹Ø×¢¡«¡«
Êý¾Ý¿â´óÅ£¶¼ÄÄÈ¥Á˰¡£¿
......
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
Êý¾Ý¿âÒªÔõôѧ²Å²»»áÏԵóéÏó°¡£¿
Õâ¾ÍÒª¿´ÄãÊʺÏʲô·½·¨ÁË£¬Õâ¾ßÌå²»ºÃ˵µÄ.....
ÔõôÁË£¬ÄѵÀ´ó¼Ò¶¼²»»á£¬»¹ÊÇÕæµÄÌ«³éÏó´ó¼Ò²»ÖªµÀÔõô˵°¡
½áºÏÄã²Ù×÷Êý¾Ý¿âµÄÌå»áºÍÀí½â£¬Ó¦¸ÃЧ¹û»á¸üºÃ¡£·ñÔò£¬Ò ......
ÎÒÃÇC#×öÒ»¸ö´°Ìå ÍùÊý¾Ý¿âÀï²åÈëÊý¾Ý
SqlConnection cn = new SqlConnection("Data Source=20090713-1752\\SQLEXPRESS;Initial Catalog=goods;Integrated Security=True");
......