I want the sql like query that ignores the first word from the field completely, I want remaining word.
For example:
Name:
John Smith
ABC XYZ PQR
Output :
Smith
XYZ PQR
I want the string after the first (whitespace)
Thanks in advance.
Try this:
SELECT RIGHT(Name, LENGTH(Name) - LOCATE(' ', Name))
FROM mytable
Function LOCATE returns the position of the first occurrence of space inside the column (if any). Using RIGHT we can easily extract the part that comes right after this space occurrence.
Just use it.
SELECT SUBSTRING(name, LOCATE(' ', name)+1) FROM mytable
*name = Field Name,
*mytable= Table Name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With