473,326 Members | 2,108 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,326 software developers and data experts.

I have a Problem With Stored proc_ help needed

Hi,.. to all..

I have quierry in stored procecedure. ie:

select distinct Member_ID,m_displayname,brand_name,Brand_ID,produc t_id,
count(product_id) as ImagesCount from dbo.vSMgr_ImageReport
where brand_owner = @MemberID
group by brand_id, brand_name,product_id,Member_ID,m_displayname.

In the above quierry ImagesCount is the sum(product_id)...

Now i need sum(ImagesCount) how can i get using that same quierry...

Help shold be thankfull...

@shraf
Apr 22 '08 #1
1 930
deric
92
Try it like this:
Expand|Select|Wrap|Line Numbers
  1. select *, sum(ImagesCount) As SumImagesCount
  2. from
  3. (
  4. select distinct Member_ID,m_displayname,brand_name,Brand_ID,product_id,
  5. count(product_id) as ImagesCount from dbo.vSMgr_ImageReport          
  6. where brand_owner = @MemberID
  7. group by brand_id, brand_name,product_id,Member_ID,m_displayname
  8. )
  9.  
If your purpose of getting the sum of all ImagesCount is just for display, you might consider doing it in your front-end application rather than doing it in your query where it causes additional overhead.
Apr 23 '08 #2

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

Similar topics

8
by: Jim R | last post by:
The following is a create that I was trying to run in SQL/2000 SQL Analyser: CREATE TABLE tblxyz as (Select * from tblPlayers); tblPlayers has 2 rows in it. I continue to get the error ...
7
by: ChadDiesel | last post by:
Hello everyone, I'm having a problem with Access that I need some help with. The short version is, I want to print a list of parts and part quantities that belong to a certain part group---One...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
9
by: Nikolay Petrov | last post by:
How to fill DataSet from stored procedure?
2
by: Don | last post by:
I'm new to MySQL and am having a frustrating time figuring out some of the tools. I'm getting ERROR 1044 when I try to execute the following sp. ------------------------------ DELIMITER $$ ...
16
by: Martin Joergensen | last post by:
Hi, I wanted to try something which I think is a very good exercise... I read in data from the keyboard and store them in a structure. There's a pointer called "data_pointer" which I use to...
0
by: Richard Carpenter | last post by:
I am working on a small project in which I am trying to implement a data access layer through the use of a project dataset schema. Data integrity and normalization will be handled through the use...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
9
by: smartbei | last post by:
Hello, I am a newbie with python, though I am having a lot of fun using it. Here is one of the excersizes I am trying to complete: the program is supposed to find the coin combination so that with...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.