PostgreSQL special sql 1 - list all the columns and primary
发布时间:2020-12-13 17:30:34 所属栏目:百科 来源:网络整理
导读:There are a few special sql commands that I used often recently,mark them here. 1: Show all the columns' name SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='yourtablename'; another solution d 'yourtablename' 2: Show the primar
There are a few special sql commands that I used often recently,mark them here.
1: Show all the columns' name SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='yourtablename';
another solution d 'yourtablename' 2: Show the primary key: SELECT pg_attribute.attname,format_type(pg_attribute.atttypid,pg_attribute.atttypmod) FROM pg_index,pg_class,pg_attribute WHERE pg_class.oid = 'nygeotwitters'::regclass AND indrelid = pg_class.oid AND pg_attribute.attrelid = pg_class.oid AND pg_attribute.attnum = any(pg_index.indkey) AND indisprimary; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ruby-on-rails – rails in_groups和in_groups_of之间有什么
- [Swift Weekly Contest 116]LeetCode963. 最小面积矩形 II
- JSON.parse()和JSON.stringify()
- jQuery通过ajax请求php遍历json数组到table中的代码(推荐)
- vb6.0 实现 picturebox 圆形显示
- c# – JavaScript Object.create和IE8
- 更改标签栏未选中图标颜色迅捷
- xcode 6.1 iOS 8.1 NSLocale displayNameForKey NSLocaleId
- 使用JSON.NET将JSON数据反序列化为C#
- 为什么在我的xcode项目文件中恢复了引用?