How do I return all postal codes for a country from the orders table to return the postal code in format xxx-xxx
in sql?.
Asked
Active
Viewed 99 times
-1

Elyor
- 5,396
- 8
- 48
- 76

ProgrammerBeginner
- 15
- 4
-
Have you tried anything so far to accomplish this? – michaelpri Jul 20 '15 at 02:57
-
what's you table structure ? – Ravi Jul 20 '15 at 05:54
1 Answers
0
These SQL will useful to you.
MYSQL:- SELECT CONCAT(SUBSTRING('524401', 1, 3),'-',SUBSTRING('524401', 4, 6));
oracle: SELECT CONCAT(SUBSTR(TO_CHAR(524401), 1, 3),'-',SUBSTR(TO_CHAR(524401), 4, 6)) FROM DUAL;
Thank you.

Venkatesh Panabaka
- 2,064
- 4
- 19
- 27
-
ORA-00909: invalid number of arguments 00909. 00000 - "invalid number of arguments" *Cause: *Action: Error at Line: 1 Column: 8 – ProgrammerBeginner Jul 20 '15 at 02:53
-
-
I updated my answer can you check it once. mysql query you are trying in oracle database it will not work. I updated oracle sql you can check it. – Venkatesh Panabaka Jul 20 '15 at 03:04