元のユーザーのデータをほぼ複製するビューを作成していますが、ユーザーがダウンロード テーブルに持っている発生回数を入れたい属性もあります。
CREATE VIEW customer_count_streams_vw(
sid_customer
systemuser_id
postcode
age
gender
num_streams)
AS
SELECT
user.sid_customer,
user.systemuser_id,
user.postcode,
user.age,
user.gender,
num_streams
FROM md_customer
INNER JOIN ods_streaming AS num_streams (
SELECT COUNT(ods_streaming.sid_customer)
WHERE ods_streaming.sid_customer = md_customer.sid_customer)
私が望むのは、パーツの結果を配置することです:
SELECT COUNT(ods_streaming.sid_customer)
WHERE ods_streaming.sid_customer = md_customer.sid_customer
num_streams
フィールドに。