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

Count the data

I have a table called program within it are several fields including:

id_program
id_student

how I want to get id_student based on highest id_program volumes of data

let say row in table:-

row 1 : id_program : 1, id_student :001,
row 2 : id_program : 2, id_student :001,
row 3 : id_program : 3, id_student :002,
row 4 : id_program : 4, id_student :001,
row 5 : id_program : 5, id_student :003.


query that i need is it will result like this :-
highest program : 001
Number program : 3
Apr 27 '12 #1
5 1679
Rabbit
12,516 Expert Mod 8TB
I have no idea how you went from your sample data to your results.
Apr 27 '12 #2
I want to get the most id_student create programs
Apr 28 '12 #3
Rabbit
12,516 Expert Mod 8TB
Yes, you've already said that, I don't know what you mean by it.
Apr 28 '12 #4
You can simply Use
Select Id_student as highest_program, Count(Id_student) as Number_program From Your table name
Apr 29 '12 #5
deric
92
This question belongs to SQL. Anyway, use GROUP BY and COUNT together

Expand|Select|Wrap|Line Numbers
  1. SELECT COUNT(id_program) AS prog, id_program, id_student FROM YourTable GROUP BY id_student
Apr 30 '12 #6

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

Similar topics

0
by: DataFreakFromUtah | last post by:
Hello! No question here, just a procedure for the archive. Search critera: count records imported count data imported count number of rows imported count number of records imported record import...
4
by: ralf321 | last post by:
Hello! i want to count elements in xslt. All with meta=13 contains a AND meta 14 contains b but it dont work any Idee why? Thanks. i try it with count(object/node/data)
15
by: Geagleeye | last post by:
Hi. I need to interpolate som data i have in my tabel. my tabel looks like this. Y X 0 0 0,026 0,037 0,003 0,038 0,005 0,064
7
by: arynn | last post by:
hi. i have a table name result that contain result from a survey form. The table have username, a1,a2,a3,a4,a5,a6,.......a75 column which represent username and their answers to each question....
4
by: uprakash14 | last post by:
i have import excel data in MSflexgrid.. Now i want to count the data for particulars fields... Like Data have four column A, B, C and D while using A column, i have to calculate the data of B...
3
beacon
by: beacon | last post by:
Hey everybody, I'm using 2003 and wondering if there's a way to count the data for multiple sections in a report and summarize it at the end of the section. For instance, I have a report with a...
3
by: mlvander | last post by:
I would like to be able to sum data in one table and count data in another table with one query. Is this possible ? Below is an example of what I would like to accomplish. tbl_class classid |...
3
by: lilbit02 | last post by:
Hi, I want to grab data from a .csv file and add all the data to the array. I have the part where I'm grabbing the data from the .csv file but the array issue I haven't totally figured out. ...
3
by: plaguna | last post by:
I'm trying to Count data in a Query Combining two different fields based on the "Date" the product was sold, and for some reason I get a wrong data. When I use only this expression, It works fine:...
6
by: KLoux | last post by:
Hello all! I have a class like this: class MyClass { public: MyClass(int Count) { Data = new double;
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.