Solved

get username and the com1+com2 fields and then sum them for the entire user id in sql server

Posted on 2014-11-05
2
73 Views
Last Modified: 2014-11-11
get username and the com1+com2 fields and then sum them for the entire user id in sql server
0
Comment
Question by:cbrune
2 Comments
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
What's a 'com1+com2' fields?

SELECT SUSER_NAME() as login_name, USER_NAME() as user_name
0
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 500 total points
Comment Utility
It's hard to understand the question but I'll try to guess that you want a SUM of fields grouped by users:
SELECT id, name, SUM(com1+com2)
FROM TableNameHere
GROUP BY id, name

Open in new window

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now