473,378 Members | 1,422 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,378 software developers and data experts.

Displaying specific data from the database

This are my database columns
1)Ipaddress(address of client machine) 2)data received (content downloaded from server)3)url(sites accesssed by the users)






I want to display Ipaddresses based on highest data received.that is first i will have to sum the data recceived by particular ip address and then display the ip address that has received highest data.

Expand|Select|Wrap|Line Numbers
  1.  
  2. select ip_address,sum(data_received) from log group by ip_address,data_received ORDER BY data_received desc ;
  3.  
  4.  

when i try this the output I get is wrong not all the data is in descending order.
Apr 5 '08 #1
2 1364
mafaisal
142 100+
Hello

Try This

Expand|Select|Wrap|Line Numbers
  1. Select ip_address,Data_rec From (select ip_address,sum(data_received)  as Data_rec from log group by ip_address,data_received) as Dt Order By Data_rec  Desc
  2.  
  3.  
In here i think in group by option data_received is not needed
Try with that & without that to got ur output

Faisal


This are my database columns
1)Ipaddress(address of client machine) 2)data received (content downloaded from server)3)url(sites accesssed by the users)






I want to display Ipaddresses based on highest data received.that is first i will have to sum the data recceived by particular ip address and then display the ip address that has received highest data.


select ip_address,sum(data_received) from log group by ip_address,data_received ORDER BY data_received desc ;

when i try this the output I get is wrong not all the data is in descending order.
Apr 5 '08 #2
amitpatel66
2,367 Expert 2GB
A small change to your query :

Expand|Select|Wrap|Line Numbers
  1.  
  2. select ip_address,sum(data_received) sum_data from log group by ip_address ORDER BY sum_data desc ;
  3.  
  4.  
The above query should give you correct results.
Apr 7 '08 #3

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

Similar topics

1
by: Dave Posh | last post by:
I seem to be having a problem displaying time stored in mysql. The format stored in the database is 13:15:05. The database data type is time. I'm using asp vbscript and sql to retrieve the time...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
2
by: t | last post by:
Hi, I have the following problem. The web-based software I am to create is going to display tabular data. Lots of data so I need some pagging mechanism. I thought about creating three classes:...
8
by: Jon Weston | last post by:
I'm setting up an Access2003 database with pictures. I put a bound ole picture ctrl on a form that's source is the table that contains the pictures and follow ALL the directions for embedding a...
1
by: NumberCruncher | last post by:
Hi All, I am struggling with setting up my first system of tables, forms,and reports, and could use your help! I am setting up a database to keep track of the production of a produced item. The...
13
by: David W. Fenton | last post by:
I've been struggling the last two days with something I thought was very easy, which is to open a web page with a form on it and populate the form with data passed in a query string (either POST or...
0
by: darrel | last post by:
Hi there, good day! i need some help in displaying my records,,, my assignment is i have to display a database records in a labels. Its like this in my database i have a table called "SUBJECTS"...
3
by: printline | last post by:
Hello All I need a little help with a phph script to display some specific data from a mysql table. I have a mysql table with 4 columns and 10 rows. I want to display fx. data from row 4, 6, 8...
1
by: Dave | last post by:
I'm having problems getting the GridView to reliably display a large amount of data (50,000+ rows). I am working my way through the excellent book “Real World ASP.NET Best Practices” by Farhan...
0
by: Del | last post by:
Hello and thanks for any and all assistance! I have a database that is used by several users on several different machines. The backend database is housed on a file server. Each user has a...
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...
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.