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
79 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 40425311
What's a 'com1+com2' fields?

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

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40428561
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

738 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