【问题标题】:How to see Table columns in sorted order in Sybase如何在 Sybase 中按排序顺序查看表列
【发布时间】:2015-08-16 00:00:25
【问题描述】:

sp_help 列出了表列,但它们没有按照它们的名称排序(我猜可能是按照它们在表中出现的实际顺序)。对于表中的许多列,很难找到列名,所以有什么办法可以让我看到按名称排序的列名。

【问题讨论】:

  • 是否支持信息架构? select table_name, column_name from information_schema.columns order by table_name, column_name?
  • 试试select col.name from sysobjects tab inner join syscolumns col on tab.id = col.id where tab.type = 'U' and tab.name = 'TABLE_NAME' order by col.name
  • 感谢@Sachu ..查询有效! ..不确定information_schema ..
  • @user1107108 发布为答案 :)..你不确定 abt 信息架构

标签: sql database sybase sap-ase


【解决方案1】:
select col.name from 
sysobjects tab 
inner join 
syscolumns col 
on tab.id = col.id 
where tab.type = 'U' 
and tab.name = 'TABLE_NAME' 
order by col.name

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-09-15
    • 2017-02-27
    • 1970-01-01
    • 1970-01-01
    • 2018-08-22
    • 1970-01-01
    相关资源
    最近更新 更多