mysql & gbase 常用函数
时间:2011-05-21 来源:mefly
MYSQL查询表结构
1 show columns from 表名 (describe 表名);
show full fields from `tsysmenu` // 比上面那个更全面
SHOW FULL TABLES FROM `tjjsw` LIKE 't%' 查询库中所有的表名
2 show create table 表名; //查建表语句
use information_schema
select * from columns where table_name='表名'
/*this can see the table information*/
show table status from `fortioa`;
/*this can see all the fields detail information of a table including the character set*/
show full fields from `account`
/*change the table column`s character set to utf8*/
ALTER TABLE `purchaserequest` CHANGE `justification` `justification` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
删除语句(DELETE)
在数据库中,有些数据已经失去意义或者是错误的,就需要将它们删除,此时可以使用DELETE语句,该语句的格式如下:
Delete from table_name
Where condition
通过 Wiz 发布
1 show columns from 表名 (describe 表名);
show full fields from `tsysmenu` // 比上面那个更全面
SHOW FULL TABLES FROM `tjjsw` LIKE 't%' 查询库中所有的表名
2 show create table 表名; //查建表语句
use information_schema
select * from columns where table_name='表名'
/*this can see the table information*/
show table status from `fortioa`;
/*this can see all the fields detail information of a table including the character set*/
show full fields from `account`
/*change the table column`s character set to utf8*/
ALTER TABLE `purchaserequest` CHANGE `justification` `justification` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
删除语句(DELETE)
在数据库中,有些数据已经失去意义或者是错误的,就需要将它们删除,此时可以使用DELETE语句,该语句的格式如下:
Delete from table_name
Where condition
通过 Wiz 发布
相关阅读 更多 +