<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>sql server instructions  help 入門</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/" />
    <link rel="self" type="application/atom+xml" href="http://blast.websky21.com/atom.xml" />
    <id>tag:,2009-01-13:/38</id>
    <updated>2009-10-30T13:43:45Z</updated>
    <subtitle>sql server instructions  help 入門</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Open Source 4.1</generator>

<entry>
    <title>SQL  TO_NUMBER関数</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/10/sql-to-number.html" />
    <id>tag:blast.websky21.com,2009://38.1235</id>

    <published>2009-10-30T12:53:55Z</published>
    <updated>2009-10-30T13:43:45Z</updated>

    <summary>   SQLのTO_NUMBER関数についてです。  ...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="SQL  TO_NUMBER関数" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlto_number関数" label="SQL TO_NUMBER関数" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[<table x:str="" style="border-collapse: collapse; width: 212pt;" border="0" cellpadding="0" cellspacing="0" width="282"><col style="width: 212pt;" width="282"><tbody><tr style="height: 13.5pt;" height="18">
  <td style="height: 13.5pt; width: 212pt;" height="18" width="282">SQLのTO_NUMBER関数についてです。</td>
</tr></tbody></table> ]]>
        <![CDATA[<a href="http://pt.afl.rakuten.co.jp/c/07e6f7cf.b9c52da0.07e6f7d0.c4983b75/?url=http%3a%2f%2fesearch.rakuten.co.jp%2frms%2fsd%2fesearch%2fvc%3fsv%3d2%26sitem%3dTO_NUMBER" target="_blank">TO_NUMBER</a><img src="http://ba.afl.rakuten.co.jp/b/07e6f7cf.b9c52da0.07e6f7d0.c4983b75/" border="0" height="1" width="1" />

関数は、数値、文字列や浮動小数 を<br /><br />書式にしたがって NUMBER 型に変換する関数です。<br /><br />TO_NUMBER 関数は、指定した文字列型のデータを<br /><br />数値型のデータに変換するときに使用します。<br /><br /><a href="http://pt.afl.rakuten.co.jp/c/07e6f7cf.b9c52da0.07e6f7d0.c4983b75/?url=http%3a%2f%2fesearch.rakuten.co.jp%2frms%2fsd%2fesearch%2fvc%3fsv%3d2%26sitem%3dTO_NUMBER" target="_blank">TO_NUMBER</a><img src="http://ba.afl.rakuten.co.jp/b/07e6f7cf.b9c52da0.07e6f7d0.c4983b75/" border="0" height="1" width="1" />

 関数は、文字データを数値データに変換する関数です。<br /><br />たとえば、<a href="http://pt.afl.rakuten.co.jp/c/07e6f7cf.b9c52da0.07e6f7d0.c4983b75/?url=http%3a%2f%2fesearch.rakuten.co.jp%2frms%2fsd%2fesearch%2fvc%3fsv%3d2%26sitem%3dTO_NUMBER" target="_blank">TO_NUMBER</a><img src="http://ba.afl.rakuten.co.jp/b/07e6f7cf.b9c52da0.07e6f7d0.c4983b75/" border="0" height="1" width="1" />

('STR', 'FMT')のように<br /><br />引数を２つ指定した場合には、、<br /><br />STRはFMTで指定されたフォーマットと判断されます。]]>
    </content>
</entry>

<entry>
    <title>SQL CONCAT関数　SQLのCONCAT関数について</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/10/sql-concatsqlconcat.html" />
    <id>tag:blast.websky21.com,2009://38.1212</id>

    <published>2009-10-30T12:27:04Z</published>
    <updated>2009-10-30T12:28:34Z</updated>

    <summary>SQLのCONCAT関数について　です。 ...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="CONCAT関数" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlconcat関数" label="SQL CONCAT関数" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        SQLのCONCAT関数について　です。 
        
    </content>
</entry>

<entry>
    <title>SQL ALTER　SQLのALTERとは</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/10/sql-altersqlno.html" />
    <id>tag:blast.websky21.com,2009://38.1211</id>

    <published>2009-10-30T12:21:58Z</published>
    <updated>2009-10-30T12:29:21Z</updated>

    <summary> ...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="SQL" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlalter" label="SQL ALTER" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
         
        
    </content>
</entry>

<entry>
    <title>SQL SUM関数　合計値</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/10/sql-sum.html" />
    <id>tag:blast.websky21.com,2009://38.1121</id>

    <published>2009-10-10T07:14:10Z</published>
    <updated>2009-10-10T07:15:20Z</updated>

    <summary> ★SQL★ SUM関数　合計値についてです。 ★SQL★ SUM関数は、合計値...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="SQL SUM関数　合計値" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlsum関数　合計値" label="SQL SUM関数　合計値" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

SUM関数　合計値についてです。<br /><br /><b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

SUM関数は、合計値を求めます。<br /><br /><br />【SQL 例】<br />SELECT SUM(価格) FROM 寿司<br /><br />寿司　表から、 <b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

のSUM関数をしようして<br /><br />価格の合計値を出すSQLの例です。<br /><br /><br />【SQL 例】<br />SELECT SUM(年齢) FROM 顧客<br /><br />顧客　表より、SQLのSUM関数を使って<br /><br />年齢の合計値を算出するSQLの例です。<br /><br /><br />【SQL 例】<br />SELECT SUM(来店人数）　FROM　店舗<br /><br />店舗　表より、 <b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

のSUM関数にて<br /><br />店の来店人数の合計値をだすSQLの例です。<br /><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>SQL AVG関数　平均値</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/10/sql-avg.html" />
    <id>tag:blast.websky21.com,2009://38.1120</id>

    <published>2009-10-10T06:47:05Z</published>
    <updated>2009-10-10T07:13:33Z</updated>

    <summary> ★SQL★ AVG関数　平均値についてです。 ★SQL★ AVG関数は、平均値...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="SQL AVG関数　平均値" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlavg関数　平均値" label="SQL AVG関数　平均値" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

AVG関数　平均値についてです。<br /><br />
<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>


AVG関数は、平均値を求めます。<br /><br /><br />【SQL 例】<br />SELECT AVG(価格) FROM 寿司<br /><br />寿司　表から、

<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

のAVG関数をしようして<br /><br />価格の平均値を出すSQLの例です。<br /><br /><br />【SQL 例】<br />SELECT AVG(年齢) FROM 顧客<br /><br />顧客　表より、SQLのAVG関数を使って<br /><br />年齢の平均値を算出するSQLの例です。<br /><br /><br />【SQL 例】<br />SELECT AVG(来店人数）　FROM　店舗<br /><br />店舗　表より、

<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

のAVG関数にて<br /><br />店の来店人数の平均値をだすSQLの例です。<br /><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>sql コマンド　ネスト　関数　使用</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/04/sql.html" />
    <id>tag:blast.websky21.com,2009://38.411</id>

    <published>2009-04-23T14:58:44Z</published>
    <updated>2009-10-10T01:54:01Z</updated>

    <summary> ★SQL★ コマンド　ネスト　関数　使用　について ★SQL★ の関数は、ほか...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="sql" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="ネスト" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlコマンド　ネスト　関数　使用" label="sql コマンド　ネスト　関数　使用" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

コマンド　ネスト　関数　使用　について<br /><br /><b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

の関数は、<br /><br />ほかのＳＱＬの関数の結果を引数として<br /><br />使用できます。<br /><br /><br />関数の中で<br /><br />さらに<br /><br />関数を使って<br /><br />結果を出すことをネスト　といいます。<br /><br /><br />ネストは、いくらでも<br /><br />ネストすることができ<br /><br />内側の関数からはじまり<br /><br />順に値が返されます。<br /><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>sql コマンド COALESCE関数　NULL値　処理</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/04/sql-coalescenull.html" />
    <id>tag:blast.websky21.com,2009://38.410</id>

    <published>2009-04-23T14:46:04Z</published>
    <updated>2009-10-10T01:54:19Z</updated>

    <summary> ★SQL★ コマンド COALESCE関数　NULL値　処理についてCOALE...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="COALESCE関数" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="NULL値" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="sql" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlコマンドcoalesce関数　null値　処理" label="sql コマンド COALESCE関数　NULL値　処理" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

コマンド COALESCE関数　NULL値　処理について<br /><br />COALESCE関数は、リストの中で<br /><br />最初のＮＵＬＬでない値を探し、<br /><br />値を返します。<br /><br />リストの一番左にある式が<br /><br />ＮＵＬＬでなければ、その値が<br /><br />返されます。<br /><br /><b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b><br />]]>
        
    </content>
</entry>

<entry>
    <title>sql コマンド　NULLIF関数　null値　処理</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/04/sql-nullifnull.html" />
    <id>tag:blast.websky21.com,2009://38.409</id>

    <published>2009-04-23T14:37:25Z</published>
    <updated>2009-10-10T01:54:33Z</updated>

    <summary> ★SQL★ コマンド　NULLIF関数　null値　処理についてNULLIF関...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="NULLIF関数" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="NULL値" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="sql" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlコマンド　nullif関数　null値　処理" label="sql コマンド　NULLIF関数　null値　処理" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

コマンド　NULLIF関数　null値　処理について<br /><br />NULLIF関数は、NULL値を返す関数でございます。<br /><br />どういうときにＮＵＬＬ値を返すの？<br /><br />まずは、次の構文を見てください。<br /><br />NULLIF(引数１,引数２）<br /><br />NULLIF関数の引数１と引数２を比較し、<br /><br />比較した結果、２つの引数が等しい場合は、<br /><br />ＮＵＬＬを返します。<br /><br />NULLIF関数の２つの引数が<br /><br />異なる場合は、<br /><br />引数１を返しますの。<br /><br /><br /> <b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>]]>
        
    </content>
</entry>

<entry>
    <title>sql コマンド　NVL関数　null値　処理</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/04/sql-nvlnull.html" />
    <id>tag:blast.websky21.com,2009://38.408</id>

    <published>2009-04-23T14:13:04Z</published>
    <updated>2009-10-10T01:55:09Z</updated>

    <summary> ★SQL★ コマンド　NVL関数　null値　処理についてNVL関数は、一般関...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="NULL値" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="NVL関数" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="sql" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlコマンド　nvl関数　null値　処理" label="sql コマンド　NVL関数　null値　処理" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

コマンド　NVL関数　null値　処理について<br /><br />NVL関数は、一般関数の１つです。<br /><br /><b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>の一般関数は、どのデータ型においても<br /><br />機能し、Null値について処理します。<br /><br />NVL(引数１,引数２)<br /><br />NULL値を文字列に置換して結果に含めることができます。<br /><br />引数１がNULLのときは<br /><br />引数２を返します。<br /><br />引数１がNULLでないときは、<br /><br />引数１を返します。<br /><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>sql コマンド　case decode関数　使用</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/04/sql-case-decode.html" />
    <id>tag:blast.websky21.com,2009://38.407</id>

    <published>2009-04-22T14:29:35Z</published>
    <updated>2009-10-10T01:55:27Z</updated>

    <summary> ★SQL★ の中で、プログラムみたいに条件処理ができます。Oracleにおいて...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="sql" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlコマンド　casedecode関数　使用" label="sql コマンド　case decode関数　使用" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>の中で、<br /><br />プログラムみたいに条件処理ができます。<br /><br />Oracleにおいては、<br />ifのほかに<br />case式と<br />decode関数があります。<br /><br />decode関数はOracleの関数です。<br /><br /><br />select コード,身長,体重,<br />case 体重 when 50 then '50kg'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when 60 then '60kg'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when 90 then '90kg まぁ　太ってる'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when 100 then ' 100kg　太ってるよ！'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when 150 then '150kg でか！'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when 200 then '200kg 太りすぎ！'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else 'もう一度'<br />end as 感想<br />from 測定テーブル;<br /><br />select&nbsp; コード,商品名,値段<br />case when 値段 &lt;= 500 then ''安い！'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when 値段 &lt;=1000 then&nbsp; '高め'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when 値段 &lt;=2000 then '高すぎ！'<br />end as 感想<br />from 天丼価格テーブル;<br /><br /><br />decode関数については、<br />次回ご紹介します。<br /><br /><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>sql コマンド DISTINCT  SELECT 重複行　削除</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/02/sql-distinct-select.html" />
    <id>tag:blast.websky21.com,2009://38.341</id>

    <published>2009-02-18T15:22:38Z</published>
    <updated>2009-10-10T01:56:04Z</updated>

    <summary> ★SQL★ 　コマンド DISTINCT 重複行　削除通常SELECT文での問...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="DISTINCT " scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="select" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="sql" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlコマンドdistinctselect重複行　削除" label="sql コマンド DISTINCT SELECT 重複行　削除" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>　コマンド DISTINCT 重複行　削除<br /><br /><br />通常SELECT文での問い合わせ結果には<br /><br />重複行が含まれることがあります。<br /><br />こうした検索内容から重複する行を取除くには？<br /><br />答え：SELECT DISTINCTを使います。<br /><br />DISTINCT キーワードは、<br /><br /><b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b><b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

文に１回のみ使用可能です。<br /><br />全てのフィールドを選択出力す場合、<br />レコードと全く同じレコード以外が出力されます。<br /><br />例）select distinct * from table1<br /><br />通常は全件出ることでしょう。<br />つまり　select * from table1 と同じになります。 ]]>
        
    </content>
</entry>

<entry>
    <title>sql コマンド group by グループ化</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/02/sql-group-by.html" />
    <id>tag:blast.websky21.com,2009://38.340</id>

    <published>2009-02-18T14:50:18Z</published>
    <updated>2009-07-24T22:33:27Z</updated>

    <summary>sql コマンド group by グループ化group by は、テーブル内で...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="group by" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="select" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="sql" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="グループ化" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlコマンドgroupbyグループ化" label="sql コマンド group by グループ化" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[sql コマンド group by グループ化<br /><br />group by は、<br />テーブル内で選択された列で同じ値の行をグループ化します。<br /><br />select * from table_1 btoup by NO;<br /><br />select * sum(mny) from fruit_table group by fruit;<br /><br />sum()は、グループ全体について<br />値を計算します。<br /><br />select b,sum(c) from table group by b having sum(c) &gt; 20;<br /><br />select b,sum(c) from table group by b having b &lt; 'a'; ]]>
        
    </content>
</entry>

<entry>
    <title>postgres sql 部分インデックス</title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/02/postgres-sql.html" />
    <id>tag:blast.websky21.com,2009://38.339</id>

    <published>2009-02-18T14:35:53Z</published>
    <updated>2009-10-10T01:56:50Z</updated>

    <summary>postgres  ★SQL★ 部分インデックス部分インデックスとは、テーブルの...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="postgres " scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="sql" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="インデックス" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="postgressql部分インデックス" label="postgres sql 部分インデックス" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[postgres <b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

部分インデックス<br /><br />部分インデックスとは、<br />テーブルの部分集合に構築されるインデックスです。<br /><br />※インデックスとは、<br />インデックスとは、<br />データの検索速度を向上させるために、<br />どの行がどこにあるかを示した索引のことです。<br />データを検索するときに、<br />目的のデータが見つかるまですべての行を一行ずつ調べていくのをやめて、、<br />索引を利用して目的の行の場所を見つけてから<br />その行のデータを読み取る。<br /><br />create index]]>
        
    </content>
</entry>

<entry>
    <title>sql コマンド データ 並び替えORDER BY </title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/02/sql-order-by.html" />
    <id>tag:blast.websky21.com,2009://38.325</id>

    <published>2009-02-12T12:58:12Z</published>
    <updated>2009-10-10T01:57:40Z</updated>

    <summary> ★SQL★ コマンド データ 並び替えORDER BY 抽出したデータの並び替...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="order by" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="select" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="sql" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="並び替え" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlコマンドデータ並び替えorderby" label="sql コマンド データ 並び替えORDER BY" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>

コマンド データ 並び替えORDER BY <br /><br />抽出したデータの並び替えを行うには、<br />ORDER BY を使用する。<br /><b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>　のorder by　を使用した並び替えは、<br />列ごとに<br /><br />昇順、<br />降順、<br />NULL<br /><br />の表示順を設定できる。<br /><br />※昇順とは、データの日付を古いものから新しいものへ、<br />データ量の小さいものから大きいものへ、<br />または文字を50音順に、<br />または、アルファベットをAからZの方向へと<br />並び替えることである。<br />逆の並べ方は降順と呼ばれる。<br /><br /><br />並び替えキーワードは <br />昇順:ASC(無指定時 デフォルト) と <br />降順:DESC <br />がある。<br /><br /><br />例 order by とDESCを使った例<br /><br />SELECT * FROM table&nbsp; ORDER BY name DESC<br /><br /><br /><b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★&nbsp;</a></b>の例 order by とascを使った例<br /><br />SELECT * FROM table&nbsp; ORDER BY name asc ]]>
        
    </content>
</entry>

<entry>
    <title>sql help テーブル　列　別名  as </title>
    <link rel="alternate" type="text/html" href="http://blast.websky21.com/2009/02/sql-help-as.html" />
    <id>tag:blast.websky21.com,2009://38.324</id>

    <published>2009-02-12T12:49:32Z</published>
    <updated>2009-10-10T01:57:59Z</updated>

    <summary> ★SQL★ 　コマンドでテーブルの別名を使用する。as　を使用し、テーブルの別...</summary>
    <author>
        <name>naoto</name>
        
    </author>
    
        <category term="as" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="sql" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="別名  " scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sqlhelpテーブル　列　別名as" label="sql help テーブル　列　別名 as" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://blast.websky21.com/">
        <![CDATA[<b>
<a href="http://pt.afl.rakuten.co.jp/c/093eef01.58d3f922/?url=http%3a%2f%2fitem.rakuten.co.jp%2fbook%2f4052055%2f" target="_blank">
★SQL★
</a>
</b>　コマンドでテーブルの別名を使用する。<br /><br />as　を使用し、<br />テーブルの別名を作成できる。<br />以下を参照する。<br /><br />select * from table_name as betu_name ;<br /><br />または、<br /><br />select * from table_name betu_name ;<br /><br />長いテーブル名に短い名前を割り当てて読みやすくする。<br /><br />例&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; as を使った例です。<br /><br />select s.name,t.point from you_are_very_good_table s join thank_you_very_much_table t ;<br /><br />select s.* from sky_table as s join ground_table as g ・・・・・<br /><br /><br />長いテーブル名を短い名前に変えるのが<br />as<br />です。 ]]>
        
    </content>
</entry>

</feed>
