ÓÐÁ½¸ö±íÒ»¸öÊÇ¿Í»§¶©µ¥±í(¶©µ¥ºÅ£¬²úÆ·ºÅ£¬ÊýÁ¿£¬¼Û¸ñ£©,Ò»¸öÊÇÉÌÆ·±í(²úÆ·ºÅ£¬²úÆ·Ãû£¬²úÆ·ÊýÁ¿)
ÈçºÎÓô¥·¢Æ÷Íê³Éµ±²åÈë¿Í»§¶©µ¥±íºó£¬»á×Ô¶¯¸üÐÂÉÌÆ·±íÖеIJúÆ·ÊýÁ¿
Èô²úÆ·ÊýÁ¿²»¹»Ê±±¨´í£¨¿ÉÊä³öÎÄ×Ö±¨´íÐÅÏ¢£©
лл´ó¼Ò¡£
-- ×Ô¶¯¸üÐÂÉÌÆ·±íÖеIJúÆ·ÊýÁ¿
-- ²úÆ·ÊýÁ¿²»ÄÜΪ¸º£¬
-- ËùÒÔÔÚ×ö¶©µ¥Ê±£¬Òª¼ì²âÉÌÆ·± ......
"select (select LogisticsCompanyName from tb_LogisticsCompany where LogisticsCompanyID=a.LogisticsCompanyID) as 'LogisticsCompanyName',a.LogisticsCompanyOrderfrom,a.OrderfromID,b.MemberName,case a.OrderfromState when 0 then 'µÈ´ý·¢»õ' when 1 then 'ÒÑ·¢»õ' end as OrderfromState,a.AppendTime from ......
Card_dateTime CardNo Mc_ID
2010-05-28 16:15:00 0002001001 08
2010-05-28 16:16:00 0002001001 08
2010-05-28 16:17:00 0002001001 08
2010-05-28 16:17:00 0002001014 08
2010-05-28 16:19:00 0002001021 08
2010-05-28 16:20:00 0002001021 08
2010-05-28 16:20:00 0002001021 08
2010-05-28 16:22:00 0002001 ......
Á½¸ö±í£¬Ò»¸ö»áÔ±±í£¬Ò»¸öÏû·Ñ¼Ç¼±í¡£ÐèÒª²éµÄÊÇ×î½üÏû·ÑµÄ»áÔ±£¬È»ºó»áÔ±±íͨ¹ýÏû·Ñʱ¼äµ¹ÐòÅÅÐò¡£ÇóÖú´ó¼ÒÔõô×ö¡£ÎÒ´òËãÏÈ·Ö×飬ͳ¼Æ¿¨»áÔ±µÄ¸öÊý£¬È»ºóÔÚͨ¹ýÏû·Ñ±íÖеÄÏû·Ñʱ¼äÌõ¼þÅÅÐò£¬µ«ÕâÑùÅÅÐòÍêÈ«²»ÐС£ÇóÖú´ó¼Ò¸ÃÈçºÎ½â¾ö£¬Ð»Ð»£¡
Á½¸ö±í£¬Ò»¸ö»áÔ±±í£¬Ò»¸öÏû·Ñ¼Ç¼±í¡£ÐèÒª²éµÄÊÇ×î½üÏû·ÑµÄ»áÔ±£¬È»ºó»áÔ±±í ......
ÎÒÔÚ±¾»úÁ¬½ÓÊý¾Ý¿âÔËÐгÌÐòûÓÐÎÊÌâ,¿ÉÊÇÎҰѳÌÐò¸ÄΪÁ¬½ÓÔ¶³Ì·þÎñÆ÷ÔËÐоͳöÏÖ((ÔÚ½¨Á¢Óë·þÎñÆ÷µÄÁ¬½Óʱ³ö´í¡£ÔÚÁ¬½Óµ½ SQL Server 2005 ʱ£¬ÔÚĬÈϵÄÉèÖÃÏ SQL Server ²»ÔÊÐí½øÐÐÔ¶³ÌÁ¬½Ó¿ÉÄܻᵼÖ´Ëʧ°Ü¡£ (provider: ÃüÃû¹ÜµÀÌṩ³ÌÐò, error: 40 - ÎÞ·¨´ò¿ªµ½ SQL Server µÄÁ¬½Ó) ))Õâ¸ö´íÎó!ÎÒÓõÄÊÇsql2005 EXPRE ......
ÇóÖúÒ»ÌõSQL likeÓï¾ä!
table
ID name bran_id
1 ss 1,2
2 aa 10,13
3 cc 1,13,15
µ±bran_id like 1 µÄʱºò£¬½á¹ûÏÔʾµÄÊÇID=1ºÍµÈÓÚ3µÄ£¬¶ø2²»ÏÔʾÒòΪID=2µÄbran_id,ÊÇ10ºÍ13
ÇëÎÊÎÒÕâÌõSQLÓï¾ä¸ÃÔõôд£¿
×Ô¼º¶¥Ò»ÏÂ
bran_id like '%1,%' or '%,1,%' or '%,1%'
string strlike='1 ......