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 -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -