From b1c7c00c29d6ba589f78657be9e855094111c173 Mon Sep 17 00:00:00 2001 From: xiaochou164 Date: Mon, 14 Aug 2023 11:07:07 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=8A=A5=E8=A1=A8sql/Batc?= =?UTF-8?q?hNoResistivity=5F[excel].sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 首次提交 --- 报表sql/BatchNoResistivity_[excel].sql | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 报表sql/BatchNoResistivity_[excel].sql diff --git a/报表sql/BatchNoResistivity_[excel].sql b/报表sql/BatchNoResistivity_[excel].sql new file mode 100644 index 0000000..83f81be --- /dev/null +++ b/报表sql/BatchNoResistivity_[excel].sql @@ -0,0 +1,42 @@ +select + order_no 批次号, + resistivity 电阻档位, + min 电阻低值, + case + when min >= 1.9 then '高阻' + else '低阻' + end 高低阻 +from + ( + select + order_no , + resistivity, + case + when resistivity like '>%' then SUBSTRING(resistivity, 5, 7) + when resistivity like '%~%' then SUBSTRING_INDEX(resistivity, '~', 1) + when resistivity like '%-%' then SUBSTRING_INDEX(resistivity, '-', 1) + when resistivity like '<%' then SUBSTRING(resistivity, 5, 7) + when resistivity like '>%' then SUBSTRING(resistivity, 2, 7) + when resistivity like '<%' then SUBSTRING(resistivity, 2, 7) + when resistivity = '未分档' + or resistivity is null then '未分档' + end min + from + mes_sync.mes_recycle_material_storage mrms +union + select + order_no , + resistivity, + case + when resistivity like '>%' then SUBSTRING(resistivity, 5, 7) + when resistivity like '%~%' then SUBSTRING_INDEX(resistivity, '~', 1) + when resistivity like '%-%' then SUBSTRING_INDEX(resistivity, '-', 1) + when resistivity like '<%' then SUBSTRING(resistivity, 5, 7) + when resistivity like '>%' then SUBSTRING(resistivity, 2, 7) + when resistivity like '<%' then SUBSTRING(resistivity, 2, 7) + when resistivity = '未分档' + or resistivity is null then '未分档' + end + from + mes_sync.mes_disposable_qc_task +)a \ No newline at end of file