【问题标题】:SQL Server : how to create table with columns name as schemaname.columnnameSQL Server:如何创建列名为 schemaname.columnname 的表
【发布时间】:2018-07-24 19:15:51
【问题描述】:

我正在尝试使用以下代码创建表,但列名不显示架构名称。

Select customer as `tablename.customer`
From tablename 

我也试过了

Select customer as [tablename.customer]
From tablename 

有什么建议吗?

谢谢你, 关卡

【问题讨论】:

  • 请通读“如何提出好问题”并相应地更新您的帖子 - 您已经完成了一半的工作。
  • 使用选择你尝试创建表?
  • 它的输出是什么?是错误还是其他?
  • 您的意思是create table 还是只是返回值?帮助我们帮助您。
  • 根据您的标签,我假设您在 Dremel(现为 Apache Drill)中工作。这是正确的吗?

标签: sql sql-server dremel


【解决方案1】:

基于 Dremel / Drill 的假设,在您的查询中使用表别名,例如

Select t.customer as `tablename.customer`
From tablename t;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-22
    • 1970-01-01
    • 1970-01-01
    • 2017-04-09
    • 2013-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多