Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another SQL question
#1
Robot 
A SQL column, street, in the address table, has values with multiple lines that are separated with carriage returns. Write me a SQL query to return only the last line of the street field, ignoring all previous lines.
https://tictactech.net/forum - Inclined Discussion
 
#2
SELECT SUBSTRING_INDEX(street, '\r', -1) FROM address;
#3
Apple headphones 
(10-31-2023, 05:26 PM)rpgking Wrote: SELECT SUBSTRING_INDEX(street, '\r', -1) FROM address;

Doesn't work in SQL 2016. Substring_index is not a valid function. I guess I should have specified sql 2016.  :0 Rock On
https://tictactech.net/forum - Inclined Discussion
 
  


Forum Jump:


Users browsing this thread:
1 Guest(s)