Hello experts,
I have the following query which allows me to identify the various lines with under_score:
SELECT Cardinality,
MSTTID,
SPOTID,
SPoTInternalID FROM mstt_schema.SPOT_MSTT_MATCH
WHERE CHARINDEX('_' ,SPOTinternalID ) > 0
result:
Cardinality MSTTID SPOTID SPoTInternalID
1-1 1BN6Q5F_20171112 1BN6Q5F_20171112 439378_20171112
1-1 1C236S2_20171112 1C236S2_20171112 574109_20171112
1-1 1CKL7AK_20171109 1CKL7AK_20171109 901162_20171109
1-1 1CKL8TV_20171109 1CKL8TV_20171109 901238_20171109
I am looking for an update query in order to remove all the characters which are after _
The expected result is the following:
Cardinality MSTTID SPOTID SPoTInternalID
1-1 1BN6Q5F 1BN6Q5F 439378
1-1 1C236S2 1C236S2 574109
1-1 1CKL7AK 1CKL7AK 901162
1-1 1CKL8TV 1CKL8TV 901238
Thank you very much for your help.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
This award recognizes a member of Experts Exchange who has made outstanding contributions to the community within their first year as an expert. The Rookie of the Year is awarded to a new expert who has the highest number of quality contributions.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.