Home > database >  Check the value of A field in the table B 0. 000-000-0000 of ABC - and the second one. The data in t
Check the value of A field in the table B 0. 000-000-0000 of ABC - and the second one. The data in t

Time:10-01

Check the value of A field in the table B 0. 000-000-0000 of ABC - and the second. The data in the middle of the SQL statement how to write

CodePudding user response:

SELECT SUBSTRING_INDEX (SUBSTRING_INDEX (' 000-000-0000 0. ABC ', '. ', 1), '-', 1);

CodePudding user response:

reference 1st floor ZJCXC response:
SELECT SUBSTRING_INDEX (SUBSTRING_INDEX (' 000-000-0000 0. ABC ', '. ', 1), '-', 1);


The only guarantee is the last one "-" and the first ". "between values

CodePudding user response:

If the second - and the last one. Include any - and (or), then this is trouble to write, if the format is give the building Lord, so I write is no problem
  • Related