sql - 如何比较postgresql中的ctid?
问题描述
我正在尝试使用 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 中的 ctids 呢?
解决方案
您可以简单地使用= '(0,1)'
:
#= select ctid,* from t where ctid = '(0,1)';
┌───────┬───┐
│ ctid │ i │
├───────┼───┤
│ (0,1) │ 1 │
└───────┴───┘
(1 row)
推荐阅读
- java - 如何高效遍历Bitmap?
- javascript - 无法通过 Google Drive API 下载文件
- python - Groupby 和 Lambda 在一起
- flutter - 将图像切成相等的部分 - 或者只是调用图像的一部分?颤振 - 飞镖
- c# - 我应该如何解决以下错误消息?(111) 连接被拒绝:AH00957:HTTPS:尝试连接到 127.0.0.1:5001 (127.0.0.1) 失败
- r - 为几个类别的每个组合添加 data.table 缺失值
- ruby-on-rails - PG::DuplicateColumn:错误:关系“用户”的列“product_id”已经存在
- mysql - 无法通过 Google Data Studio 中转换后的 mysql 时间戳对条形图进行排序
- amazon-web-services - AWS Fargate 是否仅通过向其添加 AWS Auto Scaling 进行扩展?
- facebook-graph-api - 我可以使用 Facebook Graph API 向页面发送消息吗?