更改sql中数据类型的大小 [英] change the size of datatype in sql

查看:96
本文介绍了更改sql中数据类型的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个表,列 idvarchar2(20).现在我想修改它并将大小更改为 13,即列 id varchar2(13).如何实现?提前致谢

I have created a table with column id as varchar2(20). Now I want to modify it and change size to 13 i.e column id varchar2(13). How to achieve it? Thanks in advance

ps:我的表中没有任何数据.

p.s.: I don`t have any data in my table.

推荐答案

你可以在 Oracle 上试试这个:-

You may try this for Oracle:-

alter table tablename modify 
( 
   column_name    varchar2(13)
);

此外,如果表中没有任何数据,则也可以drop 表,然后create 表,列名称为 varchar2(13)

Also If you dont have any data in the table then you can also drop the table and then create the table with the columname as varchar2(13)

这篇关于更改sql中数据类型的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆