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

Problem in SUM() query

vivekgs2007
Hi to all,
I am doing a project in that the user log in and downloads the different files. every thing is working perfect but problem is...In admin area the all the details are storing in DB, I have kept separate table for that...
where the columns are
id-> primary key
uid-> user id
docid-> document id
status-> how many times user downloaded files count the files

if user downloads the file then if it is a new file that is not downloaded before then it stores first and status is 1
if user downloads the file which is already present in the DB then it just updates..
my problem is to get the distinct values of user with sum(status) of user just a sql query

please help me in this
Sep 15 '10 #1
0 865

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

Similar topics

5
by: Jerome | last post by:
Hi, I've got the following problem: I want my ASP page to display a certain number (based on a COUNT query), it works fine if the result is at least 1! If there are no records to be counted...
2
by: igor.barbaric | last post by:
Hello! I have created a very simple query like this: SELECT Tasks.Name, DurationHrs(,) AS Duration FROM Tasks INNER JOIN Log ON Tasks.TaskID=Log.TaskID; The above query works fine....
2
by: grabit | last post by:
Hi Mary this is the problem child (query) <!---Query db for page info---> <cfquery name="showtopics" datasource="parrots"> SELECT categories.catID, threads.threadID, threads.posttype,...
2
manoj9849967222
by: manoj9849967222 | last post by:
Hi All I have a problem with query. I have designed a simple query which sould give me itemwise total qty sales during a given period. the fields in the query are startdate,...
0
by: pcross29 | last post by:
I've got a table that has 3 fields: CarModel, CarColor and CarRegistration. I want to summarize the number of records by CarModel and CarColor. Easy with a sum query: Group By fields CarColor...
0
by: viki1967 | last post by:
Problem with query ASP and MySQL Hi there. I have this fields in the tbl (mysql) : - ID (unique) - user_name (text) - Date (yyyy-mm-dd) - Description (text - case A or B or C -)
3
by: DM | last post by:
Hi all, I've a problem. The query select mo_qta from oobjm.movoptittraded where mo_opzione = '1,253CEUUS16M08' gives: MO_QTA ------------------------ +2.50347710000000E+005...
1
by: milecimm | last post by:
Hi, I'm binding a sqldtatasource to a gridview to obtain some calculations from the data. However something is wrong for the query because I know the calculations are wrong. I hope I can explain...
2
by: Frank McArthur | last post by:
I have sales divided into catagories. I query each catagory with a sum query then add the results. If a catagory has no sales I get no results when I add them together. What am I doing wrong? ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.