473,395 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Display sql sum of two counts

229 100+
Hi, I wonder if anyone had a pointer for the following.


I have a main query that includes a count of visitor clicks to external websites below

Expand|Select|Wrap|Line Numbers
  1. SQLQuery= SQLQuery & "left outer join(select link_id, count(link_id) results from tblLinkTrackerLogs  group by link_id) S on P.profileId = S.link_id "
  2.  
At the time I also count the number of times websites are saved to user accounts. I was wondering if its possible to display results by the sum of the two tables totals and displaying the highest first. Something along these lines.

Expand|Select|Wrap|Line Numbers
  1. order by sum(results) + sum(other_table) desc
Thanks in advance.
Richard
May 21 '13 #1

✓ answered by Rabbit

Yes, you can do that.

1 1605
Rabbit
12,516 Expert Mod 8TB
Yes, you can do that.
May 21 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Steven Bethard | last post by:
I have a list of dictionaries. Each dictionary holds counts of various 'words', e.g.: py> countdicts = I need to select dicts with the constraint that the number of each 'word' totalled...
2
by: Dthmtlgod | last post by:
I am trying to display stats about our errors the users report. The backend is a SQL database. The fields I want a count of is just ProblemCat. I want to see something like this. JAN ...
0
by: yatharth | last post by:
Hi Well i tell you the situation , i am having the configsection settings like below. what i need to do is to display the sections automatically when i add new section name. after this...
17
by: kimimaro | last post by:
How do you limits employee display where you enter the department for all the employee within that department be displayed and if lets say they are 100 or so and you have to limits 10 employee per...
1
by: sunilkeswani | last post by:
Hi I am still new to access. I want to know how i can build a query which can display results from 4 different columns/fields Like. Field1 Field2 Field3 Field4 1 2 1 ...
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
2
by: libsfan01 | last post by:
Hi all! I have this javascript timer which counts down the number of secs that i put in and then then redirects my page, what i want to know is how to i modify the code so that i can input the...
3
by: Stan Brown | last post by:
Posted by Pierre Blais in the current RISKS Digest: http://catless.ncl.ac.uk/Risks/24.24.html#subj9 -- Stan Brown, Oak Road Systems, Tompkins County, New York, USA http://OakRoadSystems.com/...
1
by: AccessHunter | last post by:
Hi, I have a report for Judges and their cases Numbers, grouped by Judge Name,the detail starts on a new page every time a judge changes. On the Judge footer I am displaying Count of Total no of...
2
by: DigiLife | last post by:
Greetings all, I am trying to create a form in access 2007 that will return multiple queries (count). I have an appointment table and based off of the date selection I want a grid similar to "Cheap...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.