I am trying to weed duplicates out of a table based on the column (that is created within the query) "alpha_ssc_key". However when I run this query, it just returns all of the results (instead of eliminating rows where the "alpha_ssc_key" is a duplicate). Any help would be greatly appreciated!
This is being done within BigQuery.
WITH ssc_test_view AS (
SELECT
DISTINCT CONCAT(CAST(date AS STRING), ciq_id, CAST(quantity AS STRING), CAST(cost_basis AS STRING),fund,security,class,inv_type,share_type) AS alpha_ssc_key,
_metadata_created_at AS file_date,
realized_gain_loss,
cusip,
acq_txn_no,
acquisition_date,
security,
company,
ticker,
ciq_id,
class,
inv_type,
dis_txn_no,
quantity,
categorization,
transaction_type,
cost_basis,
share_type,
fund,
net_proceeds,
unit_cost
FROM
`fcm-dw.acquisition_ssc.ssc_log`)
SELECT
*
FROM
ssc_test_view