Reputation: 110
LATITUDE
and LATITUDE
are my two columns.
I have to combine these two columns into one column.
I have to combined these two columns as point values.
I tried this..,
SELECT `LATITUDE`, (LATITUDE) + ' ' + LONGITUDE+) AS point
FROM incident_google
but it is not working.
How to combine these two columns as one?
EX: LATITUDE= 38.8994816000000014,LONGITUDE=-76.9785097000000036
i need as
(38.8994816000000014,76.9785097000000036) as point
and say answer for this..,
thanks in advances.
Upvotes: 0
Views: 4845
Reputation: 683
SELECT '(' + convert(varchar(50),LATITUDE) + ',' + convert(varchar(50),LONGITUDE) + ')' as Point FROM incident_google
Upvotes: 0
Reputation: 2156
Use as follows,
SELECT LATITUDE, concat(LATITUDE,',' ,LONGITUDE) AS point FROM incident_google
Refer:http://www.tutorialspoint.com/mysql/mysql-concat-function.htm
Upvotes: 1
Reputation: 1026
In mysql
select CONCAT(LATITUDE, ",", LONGITUDE) as point FROM incident_google
Upvotes: 0
Reputation: 2530
Try this:
SELECT LATITUDE, '('+Convert(varchar(30),LATITUDE) + ',' + Convert(varchar(30),LONGITUDE)+')' AS point FROM incident_google
Upvotes: 0