Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何比较postgresql中的ctid?_Sql_Postgresql_Comparison - Fatal编程技术网

如何比较postgresql中的ctid?

如何比较postgresql中的ctid?,sql,postgresql,comparison,Sql,Postgresql,Comparison,我正在尝试用postgresql学习SQL。我要选择具有受尊重的ctid的特定行。我该怎么做 当我运行以下查询时:- select ctid,* from t01 where ctid = (0,11); 我得到这个错误:- operator does not exist: tid = record LINE 1: select ctid,* from t01 where ctid = (0,11) ^ HIN

我正在尝试用postgresql学习SQL。我要选择具有受尊重的ctid的特定行。我该怎么做

当我运行以下查询时:-

select ctid,* from t01 where ctid = (0,11);
我得到这个错误:-

operator does not exist: tid = record
LINE 1: select ctid,* from t01 where ctid = (0,11)
                                          ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

那么如何比较(postgre)sql中的CTID呢?

您只需使用
='(0,1)


我认为值得注意的是,
ctid
是一个字符串,其字符串表示形式是括号中的一对数字。
#= select ctid,* from t where ctid = '(0,1)';
┌───────┬───┐
│ ctid  │ i │
├───────┼───┤
│ (0,1) │ 1 │
└───────┴───┘
(1 row)