您的位置首页百科知识

在线代码格式化

在线代码格式化

的有关信息介绍如下:

在线代码格式化

程序员朋友们经常会遇到代码格式化的问题,其中最常见的就是sql、xml、json这些代码的格式化了,下面教大家如何快速格式化代码。

打开浏览器,百度搜索码工具网。

进入网站首页,这里齐集了各种方便的在线工具。

在代码处理的菜单下找到代码格式化工具。

在第一个页签中输入你的待格式化sql语句,例如:

select name,age from user where name='王五';

然后点击“格式化”按钮,即可得到如下格式化后的美观易读的sql了。

在第二个页签中输入你的待格式化xml代码,例如:

user王五21

然后点击“格式化”按钮,即可得到如下格式化后的美观易读的xml了。

在第一个页签中输入你的待格式化json数据,例如:

{"name":"王五","age":"21"}

然后点击“格式化”按钮,即可得到如下格式化后的美观易读的json了。

此外,改网站还提供了一些基本的sql建库语句以供参考,下面为大家分享几个简单的基本的sql语句:

选择:select * from table1 where 范围

插入:insert into table1(field1,field2) values(value1,value2)

删除:delete from table1 where 范围

更新:update table1 set field1=value1 where 范围

查找:select * from table1 where field1 like ’%value1%’ ---like的语法很精妙,查资料!

排序:select * from table1 order by field1,field2 [desc]

总数:select count as totalcount from table1

求和:select sum(field1) as sumvalue from table1

平均:select avg(field1) as avgvalue from table1

最大:select max(field1) as maxvalue from table1

最小:select min(field1) as minvalue from table1