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
77 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
ID: 40425311
What's a 'com1+com2' fields?

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

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

791 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