0

Hello I have a table called "cars" and column car_name which is String.How can I select everything from cars and select the last 4 chars of car_name in one table?I know how to select the last 4 chars of a column by SUBSTRING(car_name,1,4)

1
  • 2
    Please Edit your question and add some sample data and the expected output based on that data. Formatted text please, no screen shots Commented Jan 24, 2017 at 11:53

1 Answer 1

1

You can use simple query:

SELECT car_name, substring(car_name from '....$') AS car_sub AS car_sub FROM cars;

Or

SELECT car_name, right(car_name, 4) AS car_sub FROM cars;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.