ãããã¤ã³ã¹ãã¼ã«ä»£è¡¨ã®ã©ã¤ãããã¯ããã°
æååããé¨åçã«æåãæ½åºããã«ã¯ãOracleã®å ´åã¯SUBSTRé¢æ°ãSQL Serverã®å ´åã¯SUBSTRINGé¢æ°ã使ç¨ãã¾ãã ææ³ï¼ SUBSTR(word, n, [m]) SUBSTRING(word, n, [m]) wordã«æå®ããæåã®nçªç®ããmæååãæ½åºãããmãçç¥ããå ´åã¯nçªç®ããæ«å°¾ã¾ã§æ½åºããã 使ç¨ä¾ï¼æåã®2çªç®ãã3æåæ½åºãã SELECT word, SUBSTRING(word, 2, 3) wordããããSUBSTRING(word, 2, 3) âââââââââââââââââââââ- Jenny ããããenn English ãããngl people ãããeop 使ç¨ä¾ï¼æåã®3çªç®ããæå¾ã¾ã§æ½åºãã SELECT word, SUBSTR(word, 3) word ãããSUBSTR(word, 3) ââââ
About This Site. SQLã¯ãã¼ã¿ãã¼ã¹è¨èªã§ããç§ã¯ãSQLã¯ä»ã®ã³ã³ãã¥ã¼ã¿è¨èªåæ§ãå®è¡ããªããå¦ç¿ãããã¨ãåºæ¥ãã°ãæ¯è¼çç°¡åã«ãã¹ã¿ã¼ã§ããã¨èãã¦ãã¾ãã ããããåºæ¬æ å ±ãITãã¹ãã¼ã試é¨ã®å¦ç¿è ããSQLã®å¦ç¿ç°å¢ãæ§ç¯ããã®ã¯ãã容æãªãã¨ã§ã¯ããã¾ããã ããã§ï¼³ï¼±ï¼¬æ»ç¥ãä½ãã¾ããããã®ãµã¤ãã®å©ç¨è ã®çããã®ãæè¦ãå¸åããä¸çªã®ï¼³ï¼±ï¼¬å¦ç¿ãµã¤ããç®æãã¦ããããã¨æãã¾ãã
SQLã¤ã³ã¸ã§ã¯ã·ã§ã³ã«ã¤ãã¦æ¸ãã¨ãã«ä»¥ä¸ã®ã¡ãã»ã¼ã¸ãå¿ ãå«ãã¦æ¬²ããã§ãã åã«ããªãã¢ãã¹ãã¼ãã¡ã³ãã使ã 絶対ã«æååçµåã§SQLãæ§ç¯ãããã¨ãã¦ã¯ãããªã IPAã®ãå®å ¨ãªSQLã®å¼ã³åºãæ¹ããèªãã㨠ãªãã§ãããªãã¨ãæ¸ããã¨ããã¨ãååãç®æ¬ããã¦ããããã«ãªãããã®Webæè¡å ¥éããªãæ¬ã®SQLã¤ã³ã¸ã§ã¯ã·ã§ã³ã®é ã§ãSQLã¤ã³ã¸ã§ã¯ã·ã§ã³ã®å¯¾çã¨ãã¦ä»¥ä¸ã®ããã«æ¸ãã¦ãã£ãããã§ã*1ã a) å¤ãããªãã¼ã·ã§ã³ãã b) ããªãã¢ãã¹ãã¼ãã¡ã³ãã使ã ãã¡ã§ããééã£ã¦ãã¾ããåã«ééã£ã¦ããã ãã§ãªãæããããééã£ã¦ãã¾ããæ£ããSQLã¤ã³ã¸ã§ã¯ã·ã§ã³å¯¾çã¯ããæ¸ãã¹ãã§ãã åã«ããªãã¢ãã¹ãã¼ãã¡ã³ãã使ã æååçµåã§SQLãæ§ç¯ãã㪠ã¤ã±ã¦ãªãæ¬ãæ¸ã人ã¯ãªãã§å¤ã®ããªãã¼ã·ã§ã³ãããªãã¢ãã¹ãã¼ãã¡ã³ããããå ã«æ¸ããã§ããï¼å¤ã®ããªãã¼ã·ã§ã³
ãA5:SQL Mk-2ãã¯ãSQLæã®å ¥åæ¯æ´ãERå³ä½æãªã©ã®æ©è½ãåããé«æ©è½ãªSQLéçºç°å¢ãWindows 98/2000/XP/Server 2003/Vista/Server 2008/Vista x64ã«å¯¾å¿ããå¯ä»æè¿ã®ããªã¼ã½ããã§ãä½è ã®Webãµã¤ããããã¦ã³ãã¼ãã§ããã æ¬ã½ããã¯ãSQLæã®ä½æã»å®è¡ãè¡ããæ±ç¨ã®ãã¼ã¿ãã¼ã¹éçºç°å¢ãADOãODBCãã©ã¤ãã¼ãå©ç¨ãã¦å種ãã¼ã¿ãã¼ã¹ã«æ¥ç¶å¯è½ã§ãæ¬ã½ããã§ä½æããSQLæãå®è¡ãããã®çµæã表示ã§ãããã¾ããSQLã®å®è¡è¨ç»ãåå¾ããããå®è¡çµæããExcelãã¸åºåãããã¨ãå¯è½ã ç»é¢ã¯ãµã¤ããã¼ã¨ç·¨éç»é¢ã®2ã¤ã«åå²ããã¦ããããµã¤ããã¼ã§ã¯ãã¼ã¿ãã¼ã¹ããã³é¢é£ããã¹ãã¼ãã»ãã¼ãã«ã»ãã¥ã¼ã¨ãã£ãé ç®ãããªã¼å½¢å¼ã§è¡¨ç¤ºããããç·¨éç»é¢ã¯ã¿ãåãæ¿ãå¼ã«ãªã£ã¦ãããSQLæããã¼ãã«ãªã©ãè¤æ°éãã¦
ç±³ Yahoo! ã Yahoo! Pipes ã¿ããã«èªç±åº¦ãé«ãã¦ãã¾ãã¡ãã£ã¨æ¯è²ãéããµã¼ãã¹ãåºã¦ãããé¡ãã¦ãYahoo! Query LanguageãYQL ã¨å¼ã¶ããã ãSQL 風ã®è¨èªã REST ã§æãã¦ãçµæã XML ã JSON ã§åãåããã¨ãã§ãããå ·ä½çã«ãã£ã¦ã¿ãªãã¨åããã«ããã®ã§ãã¨ãããã試ãã¦ã¿ããRSS ãããã¼ã¿åå¾YQL ã使ã£ã¦ RSS ããææ°ã®ã¿ã¤ãã«10åãåã£ã¦ãã¦ã¿ãããã㪠YQL ã«ãªããããã select title from rss where url='http://d.hatena.ne.jp/nitoyon/rss' rss ãã¼ãã«ã«å¯¾ã㦠select ãçºè¡ãã¦ãããå®éã«ãã® YQL ã試ãã«ã¯ YQL ç¨ã® console ãå©ç¨ããã¨ãããï¼â»è¦ãã°ã¤ã³ï¼console ã®å·¦ä¸ã« YQL ãå ¥åãã¦
追è¨: rehash(auto-rehashãå«ã)ããã¨ãSQLæã®è£å®(seleã§ã¿ãæéµã¨ã)ãå¹ããªããªããã¨ãã¯ãåããã®äººã«æãã¦ãããã¾ããã å人çã«ã¯ãSQLã¯ãmysql> help selectãã¨ãã§ãªã³ã©ã¤ã³ãã«ããã³ãã£ã¨åºãã®ã§ãã¹ãã¼ãã®è£å®ãã§ããããªãSQLã®è£å®ã¯ã¨ããããããããã¦ãããããªã¨æã£ã¦ãã¾ãã 常ã ããã¼ãã«åã¨ãè£å®ã§ããã¨ãããªã¼ã¨æã£ã¦ããã®ã§ãããã£ã¨ããã¦ã¿ããæãã¦ãããã¾ãããããã¼ã¼ã¼ã¼ã£ãï¼ id:mikihoshi++ id:tokuhirom++ id:precuredaisuki++ ãããã§å¹çã300%ä¸ããã¾ããã(Benchmark::Stopwatchã§è¨æ¸¬) http://dev.mysql.com/doc/refman/5.1/en/mysql-command-options.html#option
INå¥ãç¨ããæ¡ä»¶æ½åº ä»åã¯ãSELECTæãå ¥ãåã«ããå¯åãåããï¼ãµãã¯ã¨ãªã¼ï¼ã説æãã¾ãã ã¾ãã¯ãæ¬è¬åº§ã®ç¬¬1åï¼ãSQLã®åºç¤SELECTæãè¦ããããï¼ã§è§£èª¬ãããINããããä¸åº¦å¾©ç¿ãã¾ãããã次ã®ä¾é¡ãå®è¡ãã¦ã¿ã¦ãã ããã
SELECTæã®çµ±åãUNIONã ä»åã¯ãåãåããã®çµ±åï¼UNIONï¼ã¨ãNULLã«é¢é£ãããããã¯ã解説ããSELECTæã®æå¾ã®åã¨ãã¾ãã UNIONå¥ã使ç¨ããã¨ãããã¾ã§ã«ä½¿ç¨ãã¦ããSQLæã®çµæãçµ±åãã¦ã1ã¤ã®çµæã¨ãããã¨ãã§ãã¾ããããã¯ãååæãã¨ã®å£²ãä¸ããã¼ã¿ãå¥ã®ãã¼ãã«ã«æã£ã¦ããå ´åã«ãéè¨ããçµæã1ã¤ã®è¡¨ã¨ãã¦åç §ãããå ´åãªã©ãè¤æ°ã®åãåããçµæã®ãã¼ã¸ãå®æ½ãããå ´åã«å½¹ç«ã¡ã¾ãã ä»åã¯ã製åãã¨ã«ä»ããããå価ã®ãã¿ã¼ã³ããã¹ã¦æ´ãåºããã¨ããSQLæãä½æãã¦ã¿ã¾ãããã製åã®å価ã¯ã製åãã¹ã¿ã¼ãã¼ãã«ï¼Productsï¼ã«åºæ¬ã¨ãªãå価ãä¿åããã¦ãã¾ããã¾ããåå¼ãã¨ã«è£½åã®å価ã決å®ãã¦ããã®ã§ã注æã®æç´°ãã¼ãã«ï¼Order Detailsï¼ã«ãããã®åå¼ã«ããã製åã®å価ãç»é²ããã¦ãã¾ãããããã®2ã¤ã®ãã¼ãã«ããã®å¥ã ã®å
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}