mysql - How do I select the concatination of '$' and the value of a table column? -


i trying concatenate dollar sign value of table column in select query. tell me why sql producing error? (i include more info, simple problem)

sql code:

create table if not exists item_types (id int auto_increment primary key, name varchar(255), avgcost decimal(9, 2)); select id 'item no.' name 'item' !problem!concat('$', item_types.avgcost) 'average cost ($)' item_types;` 

you forgot commas... try :

select id 'item no.', name 'item', concat('$', item_types.avgcost) 'average cost ($)' item_types; 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -