mysql命令
select * from dxy1 ,dxy2 where dxy1.userid=dxy2.userid
select * from dxy1a left join dxy2a on dxy1a.userid=dxy2a.userid 查询2个表,所有表1,与其对应的表2的内容
上述命令查询dxy1中所有记录,并根据userid内容显示dxy2a的部分内容
mysql命令
update bmdxy set mc="河北"+mc where bm like '13%'
错误提示:
1292 - Truncated incorrect DOUBLE value: '河北'
而应用下面的命令
update bmdxy set mc=concat("河北",mc) where bm like '13%'
替换字段中的部分字符
update bmdxy set mc=replace(mc,'国外','') where bm like '9%'
update dxy47 set cityname=(select mc from bmdxy where locatedcity=bm) where cityname=locatedcity
select cityname,locatedcity from dxy47 where cityname=locatedcity
update dxy47 set doctoridentify=replace(doctoridentify,"['","")
update dxy47 set doctoridentify=replace(doctoridentify,"']","")
update dxy47 set enterprise=replace(enterprise,"[]","")
搜索
复制