init_item_data.sql

来自「尚学堂DRP项目源代码.很经典的东东.希望对大家有用.采用STRIST.HIBE」· SQL 代码 · 共 14 行

SQL
14
字号
insert into t_items (item_no, item_name, spec, pattern, category, unit) values('0001', '青霉素', 'xxx', 'yyy', 'B03', 'C01');

insert into t_items (item_no, item_name, spec, pattern, category, unit) values('0002', '清开灵', 'uuu', 'ddd', 'B02', 'C03');

M1:
select a.item_no, a.item_name, a.spec, a.pattern, b.id as category_id, b.
name as category_name, c.id as unit_id, c.name as unit_name from t_items a, t_da
ta_dict b, t_data_dict c where a.category=b.id and a.unit=c.id;

M2:
select a.item_no, a.item_name, a.spec, a.pattern, a.category as category_
id, (select name from t_data_dict where a.category=id) as category_name, a.unit
as unit_id, (select name from t_data_dict where a.unit=id) as unit_name from t_i
tems a;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?