- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我找了好几天都找不到答案!
在 MySQL 中我有 2 个表
ProcessList 包含所有来自进程表的外键
ID |Operation1|Operation2|Operation3|etc....
---------------------------------------
1 | 1 | 4 | 6 | ....
---------------------------------------
2 | 2 | 4 | 5 |....
---------------------------------------
.
.
.
Process Table
ID | Name
-------------------
1 | Quote
2 | Order
3 | On-Hold
4 | Manufacturing
5 | Final Inpection
6 | Complete
现在,我是 SQL 的新手,但我知道 MYSQL 没有我研究过的枢轴函数,我看到了一些 UNION 等示例,但我需要一个类似(伪代码)的 SQL 表达式
SELECT name FROM process
(IF process.id APPEARS in a row of the ProcessList)
WHERE processListID = 2
所以我得到了结果
Order
Manufacturing
Final Inspection
我真的需要查询的最后一行
WHERE processListID = ?
因为否则我将不得不完全重写我的应用程序,因为 SQL 存储在 Java 中的字符串中,并且应用程序仅在语句末尾提供键索引。
最佳答案
一种选择是使用union
取消透视 processlist 表并将其连接到进程表。
select p.name
from process p
join (select id,operation1 as operation from processlist
union all
select id,operation2 from processlist
union all
select id,operation3 from processlist
--add more unions as needed based on the number of operations
) pl
on pl.operation=p.id
where pl.id = ?
关于MySQL 特例枢轴,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41368918/
我有一个与这个非常相似的问题: How to pivot a MySQL entity-attribute-value schema 或者这个 Enumerating combinations via
我在 postgresql-11 中使用 crosstab() 时遇到问题。 这是我的 table , CREATE TABLE monitor(tz timestamptz, level int,
我目前正在使用 ViewPropertyAnimators 来缩放 ImageView。然而,问题是图像总是从中心向外缩放,当我希望它从最左边缩放并向右缩放时。似乎没有枢轴方法。我还有其他方法可以做到
问题 1:我有一个具有以下结构和数据的表: app_id transaction_id mobile_no node_id customer_attribute entered_value
import numpy as np import pandas as pd data = {'experiment_name': ['exp1', 'exp1', 'exp1', 'exp1', '
我正在构建一个包含多个跟踪器的系统,这些跟踪器将使用许多相同的列,因此当用户插入跟踪器时,有一个用于跟踪器的表、跟踪器列,然后是哪些列与哪个跟踪器搭配的交叉引用row 不同的列值存储在共享相同记录 I
我有一个数据帧,其中有几个变量(此处为 Var1 和 Var2),这些变量在不同位置(此处为 Station)是不同的。然后我有一定数量的案例,对于每个案例,我在每个位置都会得到不同的值。 例如: n
我们正在开发 C# 应用程序,我们一直在使用 Linq to SQL 或标准 ADO(当需要性能时)与 SQL Server 一起工作。 我们有一个这样布置的表: 客户 ID、年/月、产品名称、数量
如何在 UWP 上创建一个枢轴,如果选中标题选项卡上的按钮,它将导航到其他页面?以及如何在标题选项卡上使用图像?例如在下图中,如果选择选项卡标题“Store”,它将导航到“Store”页面。 我试过搜
开始了解它的所谓的枢轴,但无法在没有聚合的情况下获得 sqlite 的示例。 架构: Readonly Table foos(_id, foo) (10 max records) Readonly T
我在 postgres 中有一个表(这是查询的结果),它有一组行(复杂的数据求和的结果),如下所示:(列名是每一天的名称, 每列的值都是 double 。) 周日周一周二周三周四周五 1.24 1.1
我已经学习和练习 sql 大约 6 个月了。我已经准备好投入其中,只是承认我对此很愚蠢,而且我的大脑无法理解它的大部分模式。我正在尝试创建一个数据透视表。关于这个主题的简单文献并不多,我找到的一个来源
我有一些模仿以下结构的数据: rdd = sc.parallelize( [ (0,1), (0,5), (0,3), (1,2
我有一个如下所示的数据框: id Revenue Cost qty time 0 A 400 50 2 1 1 A
我正在使用 Laravel 4 构建应用程序,但偶然发现了数据透视表的问题。 我有一个用户模型、一个建立模型和一个 StudyLevel 模型。 目前,为了找到用户所在的位置,我在用户模型中使用了以下
https://databricks.com/blog/2016/02/09/reshaping-data-with-pivot-in-apache-spark.html很好地解释了一个枢轴如何为 S
我正在尝试使用 Python 为一些时间序列建模准备数据Pandas (第一个计时器)。我的 DataFrame看起来像这样: df = pd.DataFrame({ 'time': [0,
我想转换以下 Pandas 数据框 a b 0 1 2 1 1 5 2 2 4 3 1 3 4 3 7 5 2 1 到 0 1
我要获取相对于 DisplayObject 的 anchor 例子: // HOW GET THIS VALUES IN CODE Object height = 90px Objec
所以我有这个 DF: In [130]: dfAbr Out[130]: ip ospfArea router_name 0 1.1.1.1 0.0.0.2 Rou
我是一名优秀的程序员,十分优秀!