Merge develop into test - sync latest code
This commit is contained in:
31
check_nulls.js
Normal file
31
check_nulls.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const { Pool } = require('pg');
|
||||
const pool = new Pool({
|
||||
host: '47.116.196.11',
|
||||
port: 15432,
|
||||
database: 'postgresql',
|
||||
user: 'postgresql',
|
||||
password: 'Jchl1528'
|
||||
});
|
||||
|
||||
const query = `
|
||||
SELECT
|
||||
COUNT(*) as total_count,
|
||||
COUNT(apply_dept_id) as has_apply_dept_id_count,
|
||||
COUNT(apply_dept_name) as has_apply_dept_name_count,
|
||||
COUNT(*) - COUNT(apply_dept_name) as apply_dept_name_null_count,
|
||||
COUNT(main_surgeon_id) as has_main_surgeon_id_count,
|
||||
COUNT(main_surgeon_name) as has_main_surgeon_name_count,
|
||||
COUNT(*) - COUNT(main_surgeon_name) as main_surgeon_name_null_count
|
||||
FROM hisdev.cli_surgery
|
||||
WHERE delete_flag = '0'
|
||||
`;
|
||||
|
||||
pool.query(query, (err, res) => {
|
||||
if (err) {
|
||||
console.error('Error:', err.message);
|
||||
} else {
|
||||
console.log('=== 当前 cli_surgery 表空值统计 ===');
|
||||
console.log(JSON.stringify(res.rows[0], null, 2));
|
||||
}
|
||||
pool.end();
|
||||
});
|
||||
Reference in New Issue
Block a user