获取数据库字段小技巧

下面写了几条根据数据库表,获取domain中要用的数据字段sql语句。

让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:申请域名、网络空间、营销软件、网站建设、余干网站维护、网站推广。

select
concat(
concat(column_name,
concat('=',
concat(concat('#{',column_name),'}')
)
),',')

from information_schema.`COLUMNS` where table_schema='saas-export' and table_name='ss_company';

以上sql语句获得的结果如id=#{id},

select
concat(column_name,concat('=',concat(concat('#{',concat(column_name,'}')),',')))
from information_schema.`COLUMNS` where table_schema='saas-export' and table_name='ss_company'

以上sql语句获得的结果如id=#{id},

select column_name,data_type,column_comment from information_schema.COLUMNS where table_schema='saas-export' and table_name='ss_company'
以上sql语句获得的结果如
id varchar ID
name varchar 公司名称



分享标题:获取数据库字段小技巧
标题URL:http://csdahua.cn/article/pdiogp.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流