sql server - sql 2008 query. I am trying to correct this error message -


What's wrong with this code? What will be the correct syntax? Select Employee, SUM ('more than 2 orders') orders, employee employee where MEG 8117, level 16, state 1, line 1 operator data type varchar is invalid for yoga operator. .

is SM ('more than 2 orders') The part that is not understood, because the error message is trying to tell you - you do not have constant SUM a number field (or expression), a varchar (ie string).

Edit : Op explains in a comment (OP, a better idea to edit your question!):

I wanna know How was the order given for at least 2 orders and how the number of employees was told?

Employees have "handled at least two orders" to show, for example, for each order to handle, there is a record in the table :

  Select the employee from the order group Number of people having the employee (*) & gt; = 2  

This command does not show command handled those employees (the above explanation does not req the waste it does not) nor shows the number of such employees - If required instead of employee ID,

  employee ID hosting COUNT *) by order group from SELECT COUNT (DISTINCT EmployeeID) & Gt; = 2  

If any of these estimates (or my estimation on the order table) is exactly what you want, please show that the table schema (ideally only relevant parts For a question) and a simple example of what you want for a brief sample content of the table - and please keep in mind that reading your mind (when you do not give details of your problem) is not a proper practice on our part, Therefore Ni glasses and ideally a small example to provide all relevant information, including faster your questions and the best way of informative answer.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -