I have a sql field that i need to edit out characters on the left and right.
The table name is: cdr
The field name is: dstchannel
The dstchannel field shows the following data: Local/872@from-internal-6acb,1
I just the need the 872 as output
The field always has the same amount of data, so the 872 will be constaint on its position.
How would I go about writing a sql query for mysql?
If I have another query that I want to include this into, how would I do that?
Thank you
Assuming the number is always 3 characters in length:
If the length of the number is variable, you’ll need to look for the ‘@’. In T-SQL (SQL Server), you can use CHARINDEX: