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

sql ²éѯ

  ÎÒÓÐÒ»¸öÔºÍÈÕ×é³ÉµÄÊý×Ö£¬ÓÐÁ½×éÔºÍÈÕ
ÏëÔÚÉí·ÝÖ¤ºÅÖÐÌôÑ¡³öÔڸøÃÁ½×éÔÂÈÕÖ®¼ä³öÉúµÄÈË£¬²»ÖªµÀÓ¦¸ÃÔõôд.
Éí·ÝÖ¤ºÅÓпÉÄÜÊÇ15λ»òÕß18λ

ÔÂÈÕ×éºÏµÄÐÎʽÈçÏÂ
10-17/04-20
ÔÂ-ÈÕ/ÔÂ-ÈÕ
Çó½Ì¸÷λ´óÏÀ
來點數據°É~~

ÓÃÏÈÅÐ斷λ數ÔÙÓÃsubstringÈ¡

15轉換18參ÕÕ


select * from view_MemberInfo where
(
case when len(f_CardID) = 15
then substring(f_CardID,9,4)
else substring(f_CardID,11,4)
end) between '1017' and '0420'
ÕâÑùд¶Ôô

ÒýÓÃ
ÓÃÏÈÅÐ斷λ數ÔÙÓÃsubstringÈ¡

15轉換18參ÕÕ


Ö§³Ö
{{


Ïà¹ØÎÊ´ð£º

ÇóSQL£¿

´ó¼ÒºÃ£¬ÇëÎÊÔÚ±íMÖÐÓÐ×ֶΣºa b c d e 
ÎÒÏë²é³öÆäÖÐÂú×ãÏÂÃæÈÎÒâÒ»ÏîµÄÊý¾Ý£¬1.×Ö¶Îa µÄÖµ²»ÊÇ ¡®Êé»ò±Ê»ò±¾¡¯ÖÐÈÎÒ»£¬2.aΪÊéµÄʱºò×Ö¶Îb,cÊÇ¿Õ;3.µ±aֵΪ±ÊµÄʱºòdÊÇ¿Õ;4.µ±aΪ±¾µÄʱºòb,d,e¶¼ÊÇ¿Õ;5.È ......

¹ØÓÚgroup byµÄsqlÓï¾ä£¿

  with adod_dict do
    begin
    close;
    commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......

sql ÈçºÎ¼Ó±íµÄÅÅËûËø

ÒòΪÊǶà¿Í»§¶Ë²Ù×÷µÄ£¬ËùÒÔÏ£ÍûÔÚ¸üеÄʱºò£¬¿ÉÒ԰ѱíÓÃÅÅËûËøËøס£¬ÆäËûÓû§²»¿ÉÒÔ²éѯºÍÐÞ¸Ä

֮ǰ¿´µ½Ïà¹ØÎÊÌâÀïÃæÌáµ½ WITH  (XLOCK) £¬ÎÒÕâÀï¿ÉÒÔÓÃÕâ¸öÂð£¿

WITH  (XLOCK) ÓÃÍêÖ® ......

×Ü»áÅöµ½¹ÖµÄÎÊÌ⣬sqlÎÊÌâ

sql2005
select *from v_ddxx where d_sfsc='0' and (g_ssbm='1001' or g_ssbm='1002') and (xxf>0 and  xxfwzf <>0 ),Ö´ÐÐËÙ¶ÈÂýµÄÒªËÀ£¬µ«ÊÇÈç¹û°Ñ(xxf>0 and  ......

sql Óï¾äÓÅ»¯ ÎÊÌ⣿ ÇóÖú£¡

SELECT ×Ö¶Î1
  from ±í  WHERE (...) AND ×Ö¶Î1=function()

×Ö¶Î1ÓпÉÄܵÄÖµ Ϊ 0 »òÕß -1
  function ·µ»Ø 0 »òÕß -1

ÕâÑùµÄËÙ¶ÈÌ«ÂýÁË  Çë¸ßÊÖ°ïæ
¶¨£¡


ÎÒд³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ