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

ÔÚSQLÓï¾äÖÐ,ÈçºÎÈ¥µôСÊýµãºóÃæ¶àÓàµÄÁã?

select convert(numeric(10,4),iinvnowcost) from ...
decimal ºÍ numeric (À´Ô´sql Áª»ú´ÔÊé)
´ø¶¨µã¾«¶ÈºÍСÊýλÊýµÄ numeric Êý¾ÝÀàÐÍ¡£
decimal[(p[, s])] ºÍ numeric[(p[, s])]
¶¨µã¾«¶ÈºÍСÊýλÊý¡£Ê¹ÓÃ×î´ó¾«¶Èʱ£¬ÓÐЧֵ´Ó - 10^38 +1 µ½ 10^38 - 1¡£decimal µÄ SQL-92 ͬÒå´ÊÊÇ dec ºÍ dec(p, s)¡£
p£¨¾«¶È£©
Ö¸¶¨Ð¡Êýµã×ó±ßºÍÓұ߿ÉÒÔ´æ´¢µÄÊ®½øÖÆÊý×ÖµÄ×î´ó¸öÊý¡£¾«¶È±ØÐëÊÇ´Ó 1 µ½×î´ó¾«¶ÈÖ®¼äµÄÖµ¡£×î´ó¾«¶ÈΪ 38¡£
s£¨Ð¡ÊýλÊý£©
Ö¸¶¨Ð¡ÊýµãÓұ߿ÉÒÔ´æ´¢µÄÊ®½øÖÆÊý×ÖµÄ×î´ó¸öÊý¡£Ð¡ÊýλÊý±ØÐëÊÇ´Ó 0 µ½ p Ö®¼äµÄÖµ¡£Ä¬ÈÏСÊýλÊýÊÇ 0£¬Òò¶ø 0 <= s <= p¡£×î´ó´æ´¢´óС»ùÓÚ¾«¶È¶ø±ä»¯¡£
¾«¶È´æ´¢×Ö½ÚÊý
1 - 9
5
10-19
9
20-28
13
29-38
17


Ïà¹ØÎĵµ£º

SQL ServerÖÐË÷Òý

Ò»¡¢SQL ServerÖÐÊý¾ÝÐеĴ洢·½Ê½
     ÔÚSQL ServerÖдæ·ÅÊý¾ÝµÄÎļþ»áÒÔ8KBµÄ´óС·ÖÒ³¡£Ã¿Ò»Ò³¿ÉÒÔÊÇÊý¾Ý¡¢Ë÷ÒýÒÔ¼°ÆäËûSQL ServerÊý¾Ý¿âÐèҪΪÆäά»¤Êý¾ÝÎļþµÄÊý¾ÝÀàÐÍ¡£´ó¶àÊýÒ³ÊÇÊý¾ÝÒ³»òË÷ÒýÒ³¡£Ò³ÊÇSQL Server¶Á¡¢Ð´Êý¾ÝÎļþµÄµ¥Ôª¡£Ã¿Ò»Ò³Ö»°üÀ¨Ò»¸ö¶ÔÏóµÄÊý¾Ý»òË÷ÒýÐÅÏ¢£¬ËùÒÔÔÚÿһ¸öÊý¾Ý ......

SQL distinctÓ÷¨¡¡¼òµ¥group by ÃüÁî


distinctÕâ¸ö¹Ø¼ü×ÖÓÃÀ´¹ýÂ˵ô¶àÓàµÄÖظ´¼Ç¼ֻ±£ÁôÒ»Ìõ£¬µ«ÍùÍùÖ»ÓÃËüÀ´·µ»Ø²»Öظ´¼Ç¼µÄÌõÊý£¬¶ø²»ÊÇÓÃËüÀ´·µ»Ø²»ÖؼǼµÄËùÓÐÖµ¡£ÆäÔ­ÒòÊÇdistinctÖ»ÓÐÓöþÖØÑ­»·²éѯÀ´½â¾ö£¬¶øÕâÑù¶ÔÓÚÒ»¸öÊý¾ÝÁ¿·Ç³£´óµÄÕ¾À´Ëµ£¬ÎÞÒÉÊÇ»áÖ±½ÓÓ°Ï쵽ЧÂʵġ£
ÏÂÃæÏÈÀ´¿´¿´Àý×Ó£º
table±í
×Ö¶Î1      ×Ö¶ ......

¡¾×ª¡¿²ÉÓÃp6spyÍêÕûÏÔʾhibernateµÄSQLÓï¾ä

×÷ÕߣºÇñÑó
QQ£º1964477
    ËäÈ»ÔÚhibernateÖÐÓÐshow_sqlÑ¡Ïµ«ÊÇÏÔʾ³öÀ´µÄÓï¾ä´ó¶àÀàËÆ
    select * from xxx where value=?
    µ«ÊÇÓÐʱºòÎÒÃÇÐèÒªµÃµ½ÍêÕûµÄSQLÓï¾ä£¬Ôõô°ìÄØ£¿Ê¹ÓÃP6SPY¾Í¿ÉÒÔÍê³ÉÕâ¸öÈÎÎñ
    p6spyÊÇÒ»¸ö¿ªÔ´Èí¼þ£¬Ëü¿ÉÒÔ¸ú ......

ÕÒЩ²»´íµÄsqlÃæÊÔÌâ(2)

ÎÊÌâÃèÊö£º
±¾ÌâÓõ½ÏÂÃæÈý¸ö¹Øϵ±í£º
CARD     ½èÊ鿨¡£   CNO ¿¨ºÅ£¬NAME  ÐÕÃû£¬CLASS °à¼¶
BOOKS    ͼÊé¡£     BNO ÊéºÅ£¬BNAME ÊéÃû,AUTHOR ×÷Õߣ¬PRICE µ¥¼Û£¬QUANTITY ¿â´æ²áÊý
BORROW   ½èÊé¼Ç¼¡£ CNO ½èÊ鿨ºÅ£¬BNO ÊéºÅ ......

³£ÓÃSQLº¯Êý

1:replace º¯Êý
µÚÒ»¸ö²ÎÊýÄãµÄ×Ö·û´®£¬µÚ¶þ¸ö²ÎÊýÄãÏëÌæ»»µÄ²¿·Ö£¬µÚÈý¸ö²ÎÊýÄãÒªÌæ»»³Éʲô
select replace('lihan','a','b')
                             &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ