问一个plsql 基本问题

tgh_china 2007-01-29 04:29:44
有一个表 ,它有两个字段 firstname lastname

现在要求写 一个 sql语句 创建一个表 ,该表只有一个字段 name ,把上面表的数据填充到这个表里

说简单点 就是从一个表创建另一个表
...全文
263 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
tgh_china 2007-01-29
  • 打赏
  • 举报
回复
create table aa (BDMNAME) as select BDMCDTY||BDMCDKEY from LBDMCODE

这样写就可以执行了,呵呵
非常感谢

tgh_china 2007-01-29
  • 打赏
  • 举报
回复
谢谢 zealot_001() 和 letqqqgo(tea) 搞定了,不写类型就可以了
zealot_001 2007-01-29
  • 打赏
  • 举报
回复
写错了,呵呵
create table aa as select firstname||lastname 列名 from 已有表
tgh_china 2007-01-29
  • 打赏
  • 举报
回复
ORA:01773 you may not specify column datetypes in this create table
好想语法不对啊

我找你这样写的

create table aa (BDMNAME VARCHAR2(200)) as select BDMCDTY||BDMCDKEY from LBDMCODE
zealot_001 2007-01-29
  • 打赏
  • 举报
回复
create table aa(name type) as select firstname||lastname from 已有表
tgh_china 2007-01-29
  • 打赏
  • 举报
回复
这样是可以但是,创建的表字段不是只有一个

题目要求 把firstname 和lastname 放到被创建表的name 字段中,
也就是被创建的表只有一个字段 : 字段名字是name 内容是 firstname + lastname
letqqqgo 2007-01-29
  • 打赏
  • 举报
回复
create table aa as select * from 已有表

17,134

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧