<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-tw">
    <title>批踢踢實業坊 Database 板</title>
    <id>http://www.ptt.cc/bbs/Database/index.html</id>
    <link rel="self" href="http://rss.ptt.cc/Database.xml"/>
    <link rel="alternate" href="http://rss.ptt.cc/Database.xml"/>
    <updated>2012-05-17T13:53:27Z</updated>
    <entry>
        <author><name>ttnan</name></author>
        <title>Re: [SQL ] INNER/LEFT JOIN效能比較問題</title>
        <id>http://www.ptt.cc/bbs/Database/M.1337063794.A.270.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1337063794.A.270.html" />
        <published>2012-05-15T14:36:34Z</published>
        <updated>2012-05-15T14:36:33Z</updated>
        <content type="html">&lt;pre>
其實並無所謂的inner join一定比left join快的道理
一般來說inner join會比較快是因為
inner join會直接將兩邊的PK join起來
避免where condition忘記下的情形，&lt;/pre></content>
    </entry>
    <entry>
        <author><name>omnl</name></author>
        <title>[SQL ] INNER/LEFT JOIN效能比較問題</title>
        <id>http://www.ptt.cc/bbs/Database/M.1337001696.A.6D6.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1337001696.A.6D6.html" />
        <published>2012-05-14T21:21:36Z</published>
        <updated>2012-05-16T07:24:11Z</updated>
        <content type="html">&lt;pre>公司用的DB是Oracle
根據以前的記憶(及google的結果)  inner join應該效率要比 left join來的好
但進目前公司後常遇到一種情況
針對SQL條件中的某個table
用left join的速度會比inner join快上非常多(可能是上百倍以上)&lt;/pre></content>
    </entry>
    <entry>
        <author><name>blu1121</name></author>
        <title>Fw: [SQL ] update一問</title>
        <id>http://www.ptt.cc/bbs/Database/M.1336993525.A.00F.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1336993525.A.00F.html" />
        <published>2012-05-14T19:05:25Z</published>
        <updated>2012-05-15T08:51:33Z</updated>
        <content type="html">&lt;pre>※ [本文轉錄自 PHP 看板 #1FiAVo6m ]

作者: blu1121 (Big Brain) 看板: PHP
標題: [請益] update一問
時間: Mon May 14 14:36:31 2012&lt;/pre></content>
    </entry>
    <entry>
        <author><name>sing10407</name></author>
        <title>[SQL ] 取得該月哪幾天有文章</title>
        <id>http://www.ptt.cc/bbs/Database/M.1336447093.A.EAA.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1336447093.A.EAA.html" />
        <published>2012-05-08T11:18:13Z</published>
        <updated>2012-05-14T23:53:59Z</updated>
        <content type="html">&lt;pre>我想取得該月哪幾天有文章
書上寫
$article_days = &amp;$db-&gt;getCol(
  "SELECT DISTINCT DATE_FORMAT(pubDate, '%e') AS DAYS " .
  "FROM `article` " .&lt;/pre></content>
    </entry>
    <entry>
        <author><name>B9</name></author>
        <title>[資源] sqlfiddle.com</title>
        <id>http://www.ptt.cc/bbs/Database/M.1336393479.A.C21.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1336393479.A.C21.html" />
        <published>2012-05-07T20:24:39Z</published>
        <updated>2012-05-07T20:24:38Z</updated>
        <content type="html">&lt;pre>SQL Fiddle
http://sqlfiddle.com/

像是 js fiddle 一樣的網站，可以用來測試 sql queries，支援各種 database。
&lt;/pre></content>
    </entry>
    <entry>
        <author><name>peiking</name></author>
        <title>[SQL ] MySQL unique filed</title>
        <id>http://www.ptt.cc/bbs/Database/M.1336134877.A.1E7.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1336134877.A.1E7.html" />
        <published>2012-05-04T20:34:37Z</published>
        <updated>2012-05-10T22:32:41Z</updated>
        <content type="html">&lt;pre>

我的 database 已經設好了一段時間了有了一些資料
但是希望把某個欄位設成強制 unique
不知該如何改變?&lt;/pre></content>
    </entry>
    <entry>
        <author><name>LaPass</name></author>
        <title>[SQL ] 樹狀結構的SQL怎麼下？</title>
        <id>http://www.ptt.cc/bbs/Database/M.1336100493.A.C9D.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1336100493.A.C9D.html" />
        <published>2012-05-04T11:01:33Z</published>
        <updated>2012-05-04T12:56:59Z</updated>
        <content type="html">&lt;pre>在程式中
很常用到像是「樹」這種東西
例如資料夾(d:我的資料夾/相片/日本旅遊)
部門單位(頂尖大學/理學院/資訊工程研究所)
地址(地球/台灣/台北/中和路一百號)&lt;/pre></content>
    </entry>
    <entry>
        <author><name>buganini</name></author>
        <title>Re: [SQL ] 如何產生不重覆的准考證號碼?</title>
        <id>http://www.ptt.cc/bbs/Database/M.1336059823.A.D0A.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1336059823.A.D0A.html" />
        <published>2012-05-03T23:43:43Z</published>
        <updated>2012-05-04T03:16:14Z</updated>
        <content type="html">&lt;pre>
建議用
http://tw2.php.net/mysql_insert_id

因為，沒有lock table或用transaction的話，&lt;/pre></content>
    </entry>
    <entry>
        <author><name>akhu</name></author>
        <title>[SQL ] 有FOREIGN KEY的資料表如何新增資料?</title>
        <id>http://www.ptt.cc/bbs/Database/M.1336051962.A.744.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1336051962.A.744.html" />
        <published>2012-05-03T21:32:42Z</published>
        <updated>2012-05-04T02:58:25Z</updated>
        <content type="html">&lt;pre>小弟所使用的是 MS SQL 2005

因為是要新加程式的關係，所以資料庫的設定不動

我在下INSERT INTO的語法的時候就會出現&lt;/pre></content>
    </entry>
    <entry>
        <author><name>newvalentine</name></author>
        <title>[SQL ] 為何同樣條件查詢時間不一樣？</title>
        <id>http://www.ptt.cc/bbs/Database/M.1335973493.A.FA2.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1335973493.A.FA2.html" />
        <published>2012-05-02T23:44:53Z</published>
        <updated>2012-05-09T01:35:42Z</updated>
        <content type="html">&lt;pre>
最近因為工作業務上需求須要挑一些資料，因為資料有上百萬筆所以有將 index 索引
的條件盡量往前塞

可是同樣條件的 SQL&lt;/pre></content>
    </entry>
    <entry>
        <author><name>shinyboy</name></author>
        <title>[SQL ] oracle 資料型態BLOB如何寫入</title>
        <id>http://www.ptt.cc/bbs/Database/M.1335802817.A.DCC.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1335802817.A.DCC.html" />
        <published>2012-05-01T00:20:17Z</published>
        <updated>2012-05-01T00:49:20Z</updated>
        <content type="html">&lt;pre>請教各位大大，我的環境為APS.NET，語言為VB。

我找了很多資料  也沒有什麼頭緒。

Dim xConnStr As String&lt;/pre></content>
    </entry>
    <entry>
        <author><name>enher</name></author>
        <title>[SQL ] 有幾個問題想請教</title>
        <id>http://www.ptt.cc/bbs/Database/M.1335791861.A.3AF.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1335791861.A.3AF.html" />
        <published>2012-04-30T21:17:41Z</published>
        <updated>2012-05-01T13:27:58Z</updated>
        <content type="html">&lt;pre>最近剛開始接觸SQL ,SQL Server 2005 Express

遇到了幾個問題,想請教一下

1.我知道Create Database的語法,但我想問的是&lt;/pre></content>
    </entry>
    <entry>
        <author><name>calqlus</name></author>
        <title>[SQL ] 問如何在firebird上輸入中文資料..</title>
        <id>http://www.ptt.cc/bbs/Database/M.1335777470.A.3D3.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1335777470.A.3D3.html" />
        <published>2012-04-30T17:17:50Z</published>
        <updated>2012-04-30T17:17:49Z</updated>
        <content type="html">&lt;pre>前幾天摸半天才知道
.fdb.gdb都跟firebird有關
可是想做的事情卻跟軟體本身無關 = =
最後找個一個database .net的軟體
才看得見裡面的資料&lt;/pre></content>
    </entry>
    <entry>
        <author><name>Clessin</name></author>
        <title>Re: [SQL ] 如何產生不重覆的准考證號碼?</title>
        <id>http://www.ptt.cc/bbs/Database/M.1335691559.A.575.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1335691559.A.575.html" />
        <published>2012-04-29T17:25:59Z</published>
        <updated>2012-05-02T23:43:31Z</updated>
        <content type="html">&lt;pre>
在此自問自答跟大伙分享．MySQL官方手冊auto_increment約中間說明處
可解決我的問題．原文簡略如下：

For MyISAM tables you can specify AUTO_INCREMENT on a secondary column in a&lt;/pre></content>
    </entry>
    <entry>
        <author><name>tabinoyume</name></author>
        <title>[系統] 查詢頻繁,更新很少</title>
        <id>http://www.ptt.cc/bbs/Database/M.1335640601.A.DA2.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1335640601.A.DA2.html" />
        <published>2012-04-29T03:16:41Z</published>
        <updated>2012-04-30T23:14:36Z</updated>
        <content type="html">&lt;pre>現在面對的問題是
"資料庫的資料更新次數很少，但被查詢的次數很多"

依現在的架構，變成每次查詢就要合併多張資料表，總覺得有點浪費
&lt;/pre></content>
    </entry>
    <entry>
        <author><name>Clessin</name></author>
        <title>[SQL ] 如何產生不重覆的准考證號碼?</title>
        <id>http://www.ptt.cc/bbs/Database/M.1335558282.A.DD0.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1335558282.A.DD0.html" />
        <published>2012-04-28T04:24:42Z</published>
        <updated>2012-04-29T16:55:07Z</updated>
        <content type="html">&lt;pre>小弟用PHP及MySQL寫一個考試線上報名系統，考生於報名頁面填寫完後，系統會即時
產生准考證號碼．由於不同科別的考生要領到不同代碼開頭的准考證號碼，例如，
考國文的考生領到像Ch001,Ch002的准考證號而考英文的領到Eng001,Eng002的准考證號．
所以在MySQL欄位規劃，准考證號碼的欄位無法單純只用auto_increment來產生不重覆
的准考證號碼．我的做法是，先找出資料表中該科目前最後一個准考證號碼是幾號？&lt;/pre></content>
    </entry>
    <entry>
        <author><name>ST9619</name></author>
        <title>[SQL ] SQL語法效能請教</title>
        <id>http://www.ptt.cc/bbs/Database/M.1335530154.A.0B2.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1335530154.A.0B2.html" />
        <published>2012-04-27T20:35:54Z</published>
        <updated>2012-05-04T03:03:13Z</updated>
        <content type="html">&lt;pre>
大家好

心一直有個疑惑
想請問一個撰寫SQL的效能問題&lt;/pre></content>
    </entry>
    <entry>
        <author><name>kyop</name></author>
        <title>Re: [SQL ]請問這該如何下指令查詢</title>
        <id>http://www.ptt.cc/bbs/Database/M.1335446548.A.8D8.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1335446548.A.8D8.html" />
        <published>2012-04-26T21:22:28Z</published>
        <updated>2012-04-26T21:22:27Z</updated>
        <content type="html">&lt;pre>如果再多加資料
    E27 40W*3 E14 5W*1
   也是可以嗎~
: : 現在條件有兩個*
: : 請問該如何下指令 可以取得左邊*的&lt;/pre></content>
    </entry>
    <entry>
        <author><name>andy2314</name></author>
        <title>[SQL ] 新手發問巢狀SQL</title>
        <id>http://www.ptt.cc/bbs/Database/M.1335437644.A.934.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1335437644.A.934.html" />
        <published>2012-04-26T18:54:04Z</published>
        <updated>2012-04-27T18:29:35Z</updated>
        <content type="html">&lt;pre>D作者: andy2314 (sss) 看板: Database
標題: [SQL ] 新手發問
時間: Thu Apr 26 18:54:02 2012

&lt;/pre></content>
    </entry>
    <entry>
        <author><name>twoseven</name></author>
        <title>Re: [SQL ]請問這該如何下指令查詢</title>
        <id>http://www.ptt.cc/bbs/Database/M.1335424116.A.5DA.html</id>
        <link rel="alternate" type="text/html" href="http://www.ptt.cc/bbs/Database/M.1335424116.A.5DA.html" />
        <published>2012-04-26T15:08:36Z</published>
        <updated>2012-04-26T15:09:26Z</updated>
        <content type="html">&lt;pre>
MS-SQL
SELECT * FROM Product WHERE substring(規格,charindex('*',規格)+1,1) = '1'
應該有更好的方法,先試試@@
&lt;/pre></content>
    </entry>

</feed>

