sql server - Incorrect syntax in SQL query near '(' -


i believe problem near ( next quoted price syntax error of incorrect syntax near '('. appreciated. using microsoft sql-server management studio.

create view order_total  select order_num  sum (quoted_price * num_ordered) total_amount  order_line; 

in query, haven't separated columns want return commas. general syntax select statement requires them:

create view order_total  select   order_num,          sum (quoted_price * num_ordered) total_amount     order_line group order_num; 

(a way stop forgetting comma's placing them @ start of line, not @ end of them, follows:

select column1        ,column2        ,etc.   table 

makes simple comment column out putting -- in front of line without query breaking.)


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -