UNION을 사용하여 두 개의 뷰 (보기 CSP에 열이 하나 더 포함되어 있으므로 두 번째보기의 일부 항목이 2 번째 인 경우 첫 번째보기에 *를 사용하고 싶습니다)가 작동하고 싶습니다. 좋은하지만 난 올바른 값과 함께 중복 구성 ID를 가지고 *.하나의 다른 열이있는 합집합
어떻게 csp에 값이있을 때 '*'를 사용하여 행을 제거하고 해결할 수 있습니까?
SELECT csp.customer_no,
csp.contract,
csp.customer_part_no,
csp.configuration_id,
csp.catalog_no
FROM customersomething csp
UNION
SELECT spc.customer_no,
spc.contract,
spc.customer_part_no,
'*' AS "configuration_id",
spc.catalog_no
FROM
superproduct spc
+-------------+----------+-----+------------------+--------+
| customer_no | contract | ... | configuration_id | |
+-------------+----------+-----+------------------+--------+
| 17 | whatever | ... | * | view A |
| 17 | whatever | ... | right_one | view B |
+-------------+----------+-----+------------------+--------+