<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ハセテツラボ &#187; PostgreSQL</title>
	<atom:link href="http://tt-house.com/tag/postgresql/feed" rel="self" type="application/rss+xml" />
	<link>http://tt-house.com</link>
	<description>生涯一開発屋</description>
	<lastBuildDate>Fri, 03 Sep 2010 14:01:41 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PostgreSQLのNULL判定</title>
		<link>http://tt-house.com/2006/09/postgresqlnull.html</link>
		<comments>http://tt-house.com/2006/09/postgresqlnull.html#comments</comments>
		<pubDate>Mon, 04 Sep 2006 17:07:49 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.tt-house.com//wp/?p=21</guid>
		<description><![CDATA[select coalesce(カラム名, '0'); 指定したカラムがNULL...]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Ftt-house.com%252F2006%252F09%252Fpostgresqlnull.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22PostgreSQL%E3%81%AENULL%E5%88%A4%E5%AE%9A%22%20%7D);"></div>
<p>select coalesce(カラム名, &#8217;0&#8242;);</p>
<p>指定したカラムがNULLだったら「0」が返って来る。</p>
<p>select coalesce(カラム名その１, カラムその２名,&#8217;0&#8242;);</p>
<p>「カラム名その１」がNULLだったら「カラムその２」の値を使う。「カラムその２」がNULLだったら「0」を返す。</p>
<p>
「ISNULL」はポスグレにはないらしい。</p>

]]></content:encoded>
			<wfw:commentRss>http://tt-house.com/2006/09/postgresqlnull.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8216;YYYYMMDD&#8217;形式の文字列から年齢を取得する</title>
		<link>http://tt-house.com/2006/06/yyyymmdd.html</link>
		<comments>http://tt-house.com/2006/06/yyyymmdd.html#comments</comments>
		<pubDate>Mon, 19 Jun 2006 15:37:07 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.tt-house.com//wp/?p=19</guid>
		<description><![CDATA[SELECT EXTRACT(YEARS FROM  AGE(TO_DATE(文...]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Ftt-house.com%252F2006%252F06%252Fyyyymmdd.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22%27YYYYMMDD%27%E5%BD%A2%E5%BC%8F%E3%81%AE%E6%96%87%E5%AD%97%E5%88%97%E3%81%8B%E3%82%89%E5%B9%B4%E9%BD%A2%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B%22%20%7D);"></div>
<blockquote><p>SELECT EXTRACT(YEARS FROM  AGE(TO_DATE(文字列格納カラム,&#8217;YYYYMMDD&#8217;))) AS USER_AGE FROM テーブル名;</p></blockquote>

]]></content:encoded>
			<wfw:commentRss>http://tt-house.com/2006/06/yyyymmdd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>指定したテーブルのカラム一覧の取得</title>
		<link>http://tt-house.com/2006/06/post_6.html</link>
		<comments>http://tt-house.com/2006/06/post_6.html#comments</comments>
		<pubDate>Wed, 14 Jun 2006 18:59:36 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.tt-house.com//wp/?p=18</guid>
		<description><![CDATA[select attname from pg_attribute where a...]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Ftt-house.com%252F2006%252F06%252Fpost_6.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22%E6%8C%87%E5%AE%9A%E3%81%97%E3%81%9F%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%E3%81%AE%E3%82%AB%E3%83%A9%E3%83%A0%E4%B8%80%E8%A6%A7%E3%81%AE%E5%8F%96%E5%BE%97%22%20%7D);"></div>
<blockquote><p>select attname from pg_attribute where attrelid = (select oid from pg_class where relname = &#8216;テーブル名&#8217;) and attnum > 0 and atttypid > 0;</p></blockquote>

]]></content:encoded>
			<wfw:commentRss>http://tt-house.com/2006/06/post_6.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>格納しているテーブル一覧の出力</title>
		<link>http://tt-house.com/2006/03/post_5.html</link>
		<comments>http://tt-house.com/2006/03/post_5.html#comments</comments>
		<pubDate>Fri, 24 Mar 2006 16:06:20 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://www.tt-house.com//wp/?p=16</guid>
		<description><![CDATA[SELECT * FROM PG_TABLES; もちろんWHERE条件を加えて...]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Ftt-house.com%252F2006%252F03%252Fpost_5.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22%E6%A0%BC%E7%B4%8D%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%E4%B8%80%E8%A6%A7%E3%81%AE%E5%87%BA%E5%8A%9B%22%20%7D);"></div>
<blockquote><p>SELECT * FROM PG_TABLES;</p></blockquote>
<p>もちろんWHERE条件を加えて絞り込むことも可能。まずは一覧を表示してみればどういう情報が出力されるのかわかる。</p>
<blockquote><p>\d</p></blockquote>
<p>でも十分なんですけどね。</p>

]]></content:encoded>
			<wfw:commentRss>http://tt-house.com/2006/03/post_5.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
