Error report of sql concat
Ping
Ping 2021-11-03 19:22:19
0
6
1119
Choose from the options below and concatenate the "city" and "state" columns, separated by commas, into a new custom column called "new_address".

SELECT ___()____ new_address FROM customers;

This is how I filled it out

SELECT concat(city,',',state) as new_address FROM customers;

But it’s still wrong

Ping
Ping

reply all(3)
P粉880818043

Do you have an answer? This is the same, English doesn’t work either

陈磊

The statement itself should be fine, check whether the entered comma is a comma in English mode

逆旅行人

The concat function does not have the function of specifying a connector when connecting strings. You can use concat_ws. The above example is

select concat_ws(',',city,state)  as   new_address from customers;

  • reply @p粉 @陈磊 @autoload I have tried all your methods one by one, but I still get an error!
    珠穆朗玛锋 author 2023-04-03 16:19:32
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template