SQl Cookbookѧϰ±Ê¼Ç
1.select * from A where a.a='a';
Ö´ÐÐ˳Ðò ÏÈÖ´ÐÐ from ÔÚÖ´ÐÐ where ÖеĶ«Î÷ £¬×îºóÖ´ÐÐ select
2.ÁÐÖµÁ¬½Ó db2 oracle || , mysql concat(column1,'sss',column2) sqlServlerʹÓÃ+Á¬½Ó;
3. case when ±í´ïʽ then ''
when ±í´ïʽ then ''
else ''
end
4. ÏÞÖÆ·µ»ØµÄÐÐÊý
ÔÚoracleÖÐʹÓÃrownum <= n ÏÞÖÆÐÐÊý
ÔÚdb2ÖÐʹÓÃfetch first 5 rows only
×¢Òâ oracleÖÐÈç¹ûʹÓÃrownum =5 Êǵò»µ½µÚÎåÐеģ¬ÒòΪoracleµÄ²éѯÔÀí»ñȡһÐк󸳸øÐкţ¬Èç¹ûÐкÅÂú×ãÌõ¼þ·µ»Ø·ñÔòÉáÆú£¬ÕâÑùÓÀÔ¶µÃ²»µ½µÚÎåÐУ¬ÓÀÔ¶ÊǵÚÒ»ÐкŲ¢½ÓÉáÆú£¬ËùÒÔÒªÏëµÃµ½µÚÎåÐУ¬±ØÐëµÃµ½Ç°ËÄÐУ¬ËùÒÔ²éѯǰÎåÐбØÐëÊÇ<= 5;
5.null ÒªÏëÅжÏÖµÊÇ·ñΪnull±ØÐëΪ is null £¬ null²»ÄÜÓõÈÓÚ=ºÍ²»µÈÓÚ<> ºÍÈκÎÖµ±È½Ï°üÀ¨null
6¡£°´Ä£Ê½²éѯ like '%a'
Ïà¹ØÎĵµ£º
¸ù¾ÝÉúÈÕµÄxxÔÂxxÈÕ²éÕÒÔÚ$checkDate¼ÆË㣬$beforeÈÕºóÉúÈյĿͻ§£º
$checkDateΪYYYY-MM-DD
WHERE substring(ADDDATE( '$checkDate', $before ),6,10)=substring(DATE_FORMAT(birthday,'%Y-%m-%d'),6,10)
$dates ÌìÄÚÉúÈյĿͻ§Î´¿¼Âǵ½Æ½Äê¡¢ÈòÄ꣺£º
$sql.=" (dayofyear( birthday )-dayofyear( ......
UltraLite®J£ºBlackBerryÉÏÔËÐеÄСÊý¾Ý¿âºÍͬ²½ÒýÇæ
MobiLink £ºÔËÐÐÔÚ·þÎñÆ÷ÉÏÊý¾Ý¿âͬ²½·þÎñÆ÷£¬¿ÉÒÔ°ÑÉ豸ÉϵÄÊý¾Ýͬ²½µ½ºǫ́µÄ¡£°üº¬ÔÚSQL Anywhere 11ÀïÃæ¡£
SQL Anywhere ÊÇÒµÄÚÁìÏȵÄÒÆ¶¯ºÍǶÈëʽÊý¾Ý¿â£¬ÌṩÊý¾Ý¹ÜÀíºÍ½»»»¼¼Êõ£¬ÎªÒ»Ïß»·¾³ÖеÄÓ¦ÓóÌÐòÌṩ֧³Ö¡£
SQL Anywhere רΪ²»¾ß±¸ÏÖ³¡ IT Ö§³Ö¡¢Ô ......
×î½üÔÚѧϰoracleµÄʱºòÓöµ½Ò»¸öÎÊÌ⣬ÀÏÊÇŪ²»Çå³þwhere ºÍhavingµÄÇø±ð£¬ÔÚÍøÉϲéÒ»²é£¬¸Ð¾õ»¹¿ÉÒÔ£¬°ÑÒÔÏÂÎÒ²éµÄ×ÊÁÏÍÆ¼ö¸ø´ó¼Ò¡£
ÔÚselect Óï¾äÖпÉÒÔʹÓÃgroup by ×Ӿ佫Ðл®·Ö³É½ÏСµÄ×飬Ȼºó£¬Ê¹ÓþÛ×麯Êý·µ»ØÃ¿Ò»¸ö×éµÄ»ã×ÜÐÅÏ¢£¬ÁíÍ⣬¿ÉÒÔʹÓÃhaving×Ó¾äÏÞÖÆ·µ»ØµÄ½á¹û¼¯¡£group&n ......
List<Class1> li = dc.Table_1.Where(item => item.id > 1).Cast<Class1>().ToList();
Table_1 Ϊ×Ô¶¯Éú³ÉÀà, class1Ϊ×Ô¶¨ÒåÀà,ÊôÐÔÃû³Æ¶¼ÊÇÒ»ÑùµÄ,ÒªÄÜʵÏÖÉÏÃæµÄÓï¾ä,±ØÐëÓм¸¸öÌõ¼þ
Table_1 ÐèÒª¼Ì³Ðclass1,¿ÉÒÔͨ¹ýpartialÀàÀ´ÊµÏÖ
Table_1 ÊôÐÔ¼Óoverride
class1ÀïÃæµÄÊôÐÔÒªÊÇvir ......