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

Sql ²éѯ¼¼ÇÉ ÓÅÏÈÊä³öij½á¹û

SELECT EMP_ID,EMP_NO,LOGIN_NAME,EMP_NAME,SITE_CODE,DEPT_CODE,
JOB_DESC,HRMS_DEPT_CODE,MAIL_ACCOUNT,EXT_NO ,
(case when SITE_CODE='QCS' then 1 else 2 end) site
from dbo.AM_EMPLOYEE
WHERE ACTIVE = 'Y' AND EXT_NO = '6006'
order by site
ÏëÒªÔÚÔ±¹¤±íÖвé³öµç»°ºÅΪ6006µÄÔ±¹¤µÄÓ¢ÎÄÃûÀ´×÷ΪϵͳҳÃæÉÏÊäÈëµç»°ºÅ´ø³ö¸ÃͬÈÊÓ¢ÎÄÃû¡£
¶øµ±Ç°ÏµÍ³Öе绰ºÅΪ6006Óжà±Ê¼Ç¼£¬ÓÐQCSµÄijA£¬QCHµÄijB,QTYµÄijC£¬
¶øµ±Ç°ÏµÍ³Ö»ÐèÊäÈëQCSµÄ½á¹û£¬ËùÒÔÓÃÉÏÊöÓï¾äÓÅÏÈÊä³öQCSµÄ¡£


Ïà¹ØÎĵµ£º

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......

SQL °æ±¾²éѯ¼°¶ÔÓ¦¹Øϵ

Òª»ñµÃÕýÔÚÔËÐеÄSQL Server 2005µÄ°æ±¾ºÅ£¬¿Éͨ¹ýSQL Server Management StudioÁ¬½Óµ½¸Ã·þÎñÆ÷£¬È»ºóÔËÐÐÒÔÏÂSQLÓï¾ä£º
SELECT  SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
Ðк󣬿ɵõ½ÐèÒªµÄ°æ±¾ÐÅÏ¢£¬ÀýÈçÔÚÎҵĻúÆ÷ÉÏÔËÐкóµÃµ ......

SQL²éѯÓï¾ä¾«»ªÊ¹ÓüòÒª

¡¡¡¡Ò»¡¢ ¼òµ¥²éѯ
¡¡¡¡¼òµ¥µÄTransact-SQL²éѯֻ°üÀ¨Ñ¡ÔñÁÐ±í¡¢from×Ó¾äºÍWHERE×Ӿ䡣ËüÃÇ·Ö±ð˵Ã÷Ëù²éѯÁС¢²éѯµÄ±í»òÊÓͼ¡¢ÒÔ¼°ËÑË÷Ìõ¼þµÈ¡£
¡¡¡¡ÀýÈ磬ÏÂÃæµÄÓï¾ä²éѯtesttable±íÖÐÐÕÃûΪ“ÕÅÈý”µÄnickname×ֶκÍemail×ֶΡ£
 
¡¡¡¡SELECT nickname,email
¡¡¡¡from testtable
¡¡¡¡WHERE name=' ......

Sql ²éѯ¼¼ÇÉ Ä³Àý ¹ØÓÚinµÄÅÅÐò

  ÔÚÓÐʱºòʹÓÃinÓï¾ä²éѯµÄʱºò,inÓï¾äÖкܶàÏî,Èç15Ï×Ô¼ºÍ¬Ê±ÏëÈòéѯ³öÀ´½á¹ûÄܹ»°´ÕÕinÓï¾äÖиÃ×Ö¶Î˳Ðò²éѯ³öÀ´¡£
 ¶øSql ServerÊÇĬÈÏ°´ÕÕ×Ô¼ºµÄ˳ÐòÅÅÁгöÀ´µÄ£¬ËùÒÔÒ»¶¨»á°Ñ½á¹û¼¯ÖØÐÂÅÅÐòµÄ¡£
¶øÈç¹ûʹÓÃcase whenµÄ·½·¨ËäÈ»ºÜ·±Ëö£¬µ«Ò²ÊÇ¿ÉÒÔʵÏÖµÄ
 
 
select item_code,apply_dep ......

SQL Server 2005ÖеķÖÇø±í£¨Î壩£ºÌí¼ÓÒ»¸ö·ÖÇø

    ËùνÌìÏ´óÊ£¬·Ö¾Ã±ØºÏ£¬ºÏ¾Ã±Ø·Ö£¬¶ÔÓÚ·ÖÇø±í¶øÑÔÒ²Ò»Ñù¡£Ç°ÃæÎÒÃǽéÉܹýÈçºÎɾ³ý£¨ºÏ²¢£©·ÖÇø±íÖеÄÒ»¸ö·ÖÇø£¬ÏÂÃæÎÒÃǽéÉÜÒ»ÏÂÈçºÎΪ·ÖÇø±íÌí¼ÓÒ»¸ö·ÖÇø¡£
    Îª·ÖÇø±íÌí¼ÓÒ»¸ö·ÖÇø£¬ÕâÖÖÇé¿öÊÇʱ³£»á
·¢ÉúµÄ¡£±ÈÈ磬×î³õÔÚÊý¾Ý¿âÉè¼Æʱ£¬Ö»Ô¤¼ÆÁË´æ·Å3ÄêµÄÊý¾Ý£¬¿ÉÊǵ½Á˵Ú4ÌìÔõ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ