2006年6月アーカイブ
SELECT EXTRACT(YEARS FROM AGE(TO_DATE(文字列格納カラム,'YYYYMMDD'))) AS USER_AGE FROM テーブル名;
select attname from pg_attribute where attrelid = (select oid from pg_class where relname = 'テーブル名') and attnum > 0 and atttypid > 0;
SELECT EXTRACT(YEARS FROM AGE(TO_DATE(文字列格納カラム,'YYYYMMDD'))) AS USER_AGE FROM テーブル名;
select attname from pg_attribute where attrelid = (select oid from pg_class where relname = 'テーブル名') and attnum > 0 and atttypid > 0;