I have value like
b10F|b3432R|b2134D
I need to get only the first value before the pipe:
b10F
How can I do that?
I have value like
b10F|b3432R|b2134D
I need to get only the first value before the pipe:
b10F
How can I do that?
use mysql query with SUBSTRING_INDEX
SELECT SUBSTRING_INDEX("b10F|b3432R|b2134D", "|", 1)
Maybe use this query which uses CHARINDEX function to find the location of first pipe character and then uses LEFT to get data till that position -1
SELECT
LEFT(
'b10F|b3432R|b2134D',
CHARINDEX('|', 'b10F|b3432R|b2134D' ) -1
)AS Output;