master data
时间: 2023-10-24 22:05:12 浏览: 36
Master data refers to the primary data that is required for the smooth functioning of an organization. It is the core data that is used to support the day-to-day operations of a business. This data includes customer data, product data, financial data, employee data, vendor data, and other important data that is required for the efficient functioning of a business. Master data is usually created and maintained by a central authority or a master data management (MDM) system to ensure consistency and accuracy across different systems and applications within the organization. It is essential for making critical business decisions and for ensuring the smooth functioning of business processes.
相关问题
mysql中master data
Master data refers to the critical and most important data that is essential for the functioning of an organization. In MySQL, master data refers to the data that is considered the most important and is used as a primary source for decision-making processes. It includes data related to customers, products, suppliers, employees, and other critical business entities.
Master data is usually stored in a centralized database in MySQL, which can be accessed and used by various departments within the organization. This data is typically used to support various business functions such as sales, marketing, finance, and operations.
Some common examples of master data in MySQL include:
1. Customer data - includes information about customers such as their name, address, contact details, and transaction history.
2. Product data - includes information about products such as their name, description, price, and inventory levels.
3. Supplier data - includes information about suppliers such as their name, address, contact details, and payment terms.
4. Employee data - includes information about employees such as their name, job title, salary, and contact details.
5. Financial data - includes information about financial transactions such as sales, purchases, and expenses.
Master data is critical for the success of any organization, and it is essential to ensure its accuracy and completeness. Organizations should implement robust data governance and management practices to maintain the quality and integrity of master data in MySQL.
SELECT a.comm_id, c.Title house_keeper_name, ( SELECT build.id FROM erp_base.tb_base_masterdata_resource AS resource INNER JOIN erp_base.tb_base_masterdata_resource AS unit ON unit.id = resource.parent_id INNER JOIN erp_base.tb_base_masterdata_resource AS build ON build.id = unit.parent_id WHERE resource.id = a.resource_id ) resource_group FROM tb_charge_receipts_detail a LEFT JOIN erp_base.tb_base_masterdata_resource b ON b.id = a.resource_id LEFT JOIN erp_base.rf_dictionary c ON b.house_keeper = c.id GROUP BY a.comm_id,c.Title,resource_group 这个sql在mysql中报this is incompatible with sql_mode=only_full_group_by是为什么该怎么改
该错误是因为 MySQL 的版本更新,默认启用了 `ONLY_FULL_GROUP_BY` 模式,这种模式下,`GROUP BY` 必须包含所有非聚合字段。
在这个 SQL 语句中,`SELECT` 子句中的字段 `resource_group` 不在 `GROUP BY` 中,因此 MySQL 报错。
解决这个问题的方法有两个:
1. 关闭 `ONLY_FULL_GROUP_BY` 模式
可以通过修改 MySQL 的配置文件 `my.cnf` 或者在命令行中输入如下语句来关闭该模式:
```
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
```
这种方法会影响到整个 MySQL 实例的行为,需要谨慎使用。
2. 将 `SELECT` 子句中的所有字段都放入 `GROUP BY` 中
可以将 SQL 语句修改为:
```
SELECT a.comm_id, c.Title as house_keeper_name, (
SELECT build.id
FROM erp_base.tb_base_masterdata_resource AS resource
INNER JOIN erp_base.tb_base_masterdata_resource AS unit ON unit.id = resource.parent_id
INNER JOIN erp_base.tb_base_masterdata_resource AS build ON build.id = unit.parent_id
WHERE resource.id = a.resource_id
) as resource_group
FROM tb_charge_receipts_detail a
LEFT JOIN erp_base.tb_base_masterdata_resource b ON b.id = a.resource_id
LEFT JOIN erp_base.rf_dictionary c ON b.house_keeper = c.id
GROUP BY a.comm_id, c.Title, resource_group;
```
这种方法会使 SQL 语句更加冗长,但不会影响 MySQL 的全局设置。