【发布时间】:2011-05-09 03:31:51
【问题描述】:
我有一个这样的查询:-
SELECT count(*) as count FROM pg_attribute, pg_type WHERE attrelid = typrelid and typname = 'table_name' and attname in ('column1','column2','column3','column4')
我正在尝试以这种方式获取“count”列的值(当然是在我执行查询之后):-
$columnExist->getInt('count')
这里的问题是我收到“无效的结果集列:计数”。我不确定这里有什么问题,任何人都可以帮助我。不过,该查询适用于此:-
$columnExist->next() //returns 4
【问题讨论】:
-
count是保留字的问题?试试
SELECT count(*) AS c ...和$columnExist->getInt('c')。
标签: sql postgresql orm