Happy New Year!

记录一次导数据的笔记

保障类型?


联合查询 两个表
select UI.id,UI.notes,SC.id,SC.notes

from renter UI right join house SC on

UI.notes=SC.notes

---------------------------------------------------------------------------------------------

联表查询的语句

select UI.id as renterid,UI.notes as renternotes,SC.id as hid,SC.notes as hnotes

from renter UI right join house SC on

UI.notes=SC.notes

 

---------------------------------------------------------------------------------------------


SELECT
UI.id AS renterid,
UI.notes AS renternotes,
SC.id AS hid,
SC.notes AS hnotes
FROM
renter UI
RIGHT JOIN house SC ON UI.notes = SC.notes
WHERE
UI.notes LIKE '%tab2%';
---------------------------------------------------------------------------------------------

renterid renternotes hid hnotes

---------------------------------------------------------------------------------------------
"月租金":"",
"序号":"序号",


---------------------------------------------------------------------------------------------

 

赵云海


// contract_no:"",
// start_time:1609434000,//2021-01-01 01:00:00
// end_time:0,
// renter_id:"",//luable
// role_a:"乐平市公租房",
// role_b:item["姓名"],//?
// house_id:"",//lable
// house_spec_id:0,
// original_price:item['月租金'],//?
// price:item['月租金'],//?
// cash_money:yj,//? 押金
// policy:"普通",
// status:"正常",
// create_user:0,
// create_time:0,
// update_user:0,
// update_time:0,
// remarks:item.id+"tab1",//额外备注

 


---------------------------------------------------------------------------------------------

 

contract_20201021012609A1

 


---------------------------------------------------------------------------------------------


http://www.bejson.com/json/col2json/


---------------------------------------------------------------------------------------------

承租人的先不改了


---------------------------------------------------------------------------------------------


合同的 政策


---------------------------------------------------------------------------------------------


房屋的结构 和 ok

安全 级别 全部默认 A


房屋要不要加 状态 比如 火烧? 强占?


保障类型 要不要加进字段里面去 放在房屋 ?

还是把保障类型这个字段放在 合同里面?

---------------------------------------------------------------------------------------------

 

structure='null'

不详


---------------------------------------------------------------------------------------------


SELECT DISTINCT(contract_no) from contract

---------------------------------------------------------------------------------------------

查询重复的

select contract_no,id from contract
where contract_no in (select contract_no from contract group by contract_no having count(contract_no) > 1);

---------------------------------------------------------------------------------------------

1363
1395
32


1392


1395-25

1370

---------------------------------------------------------------------------------------------

房屋 474+476+420=1370
承租人 474+476+420=1370
合同 474+476+420=1370

---------------------------------------------------------------------------------------------


select contract_no,id from contract where contract_no in (select contract_no from contract group by contract_no having count(contract_no) > 1);


select contract_no,id from contract where contract_no='contract_202010241743095714A1'


select count(*) from contract

 

---------------------------------------------------------------------------------------------

 

posted @ 2020-10-26 10:07  义美-小义  阅读(77)  评论(0编辑  收藏  举报
返回顶部小火箭
世界很公平,想要最好,就一定得付出!
x
github主页