Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql postgres将2个cols合并为1个cols_Postgresql - Fatal编程技术网

Postgresql postgres将2个cols合并为1个cols

Postgresql postgres将2个cols合并为1个cols,postgresql,Postgresql,想将lat lon加入1。在结果中没有()的情况下,这是如何实现的 select name, (lat, lng) as coords from my_table 但这表明: name coords a (,) b ( 122, 333) 我需要: name coords a 122, 333 这是你需要的吗 select name, lat|| ', ' || lng as coords

想将lat lon加入1。在结果中没有()的情况下,这是如何实现的

select name, (lat, lng)  as coords from my_table
但这表明:

name      coords    
a         (,)    
b         ( 122, 333)  
我需要:

name     coords    
a        122, 333    
这是你需要的吗

select name, lat|| ', ' || lng as coords from my_table
这是你需要的吗

select name, lat|| ', ' || lng as coords from my_table