0

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.

1
  • MySQL or SQL Server? the two are different thing. Commented Mar 22, 2013 at 6:12

4 Answers 4

1

Use as follows,

 SELECT LATITUDE, concat(LATITUDE,',' ,LONGITUDE) AS point FROM incident_google

Refer:http://www.tutorialspoint.com/mysql/mysql-concat-function.htm

Sign up to request clarification or add additional context in comments.

Comments

0

Try this:

SELECT LATITUDE, '('+Convert(varchar(30),LATITUDE) + ',' + Convert(varchar(30),LONGITUDE)+')' AS point FROM incident_google

Comments

0

In mysql

select CONCAT(LATITUDE, ",", LONGITUDE) as point FROM incident_google

1 Comment

CONCAT is new in SQL Server 2012.
0

SELECT '(' + convert(varchar(50),LATITUDE) + ',' + convert(varchar(50),LONGITUDE) + ')' as Point FROM incident_google

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.