473,385 Members | 1,400 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.

Simple SQL Problem

trueadvantage
I have 1 confusion about query.

I have one data sheet which has students name and their marks.

some of the student has got same marks. I want to find out their names.

e.g.: - A 50
B 40
C 50
D 40
E 60
F 60

I want to make query for this. which will help me to find out the duplicates from that sheet means if i put "50" in a particular field the result should display as "A" "C" (bcoz "A" , "C" has got same marks.)

Please let me know if you have any suggestion or solution

Thanks,
Feb 6 '08 #1
6 1547
NeoPa
32,556 Expert Mod 16PB
Please be careful where you post your questions. I found this appended to an unrelated HowTo article (Accessing Field Values in Recordsets).

Admin.
Feb 6 '08 #2
NeoPa
32,556 Expert Mod 16PB
In response to your question, you would use SQL similar to the following (you provide little information so I had to make up my own table and field names):
Expand|Select|Wrap|Line Numbers
  1. SELECT [StudentName], [Mark]
  2. FROM [tblStudent]
  3. WHERE [Mark] In(SELECT [Mark]
  4.                 FROM [tblStudent]
  5.                 GROUP BY [Mark]
  6.                 HAVING Count(*)>1)
Feb 6 '08 #3
In response to your question, you would use SQL similar to the following (you provide little information so I had to make up my own table and field names):
Expand|Select|Wrap|Line Numbers
  1. SELECT [StudentName], [Mark]
  2. FROM [tblStudent]
  3. WHERE [Mark] In(SELECT [Mark]
  4.                 FROM [tblStudent]
  5.                 GROUP BY [Mark]
  6.                 HAVING Count(*)>1)
Hi...

First I Apologize for putting question in Howtos. and Thanks a lot for help. I will try with this query. If again i meet with same problem I will let you know all details about the work which im doin.

Thanks a lot
Feb 7 '08 #4
NeoPa
32,556 Expert Mod 16PB
Not to worry too much.
It's early days and we all make mistakes at the start.

Welcome to TheScripts :)
Feb 7 '08 #5
NeoPa
32,556 Expert Mod 16PB
Ah, I just reminded myself of the whole story with the double-post and all.
Again - no worries. I guess the first post got lost to you as it was posted in the HowTo by mistake.

Click on Subscribed (in blue at top) to find any threads you've been involved in.
Feb 7 '08 #6
NeoPa
32,556 Expert Mod 16PB
This thread now continues in another one (Query Problem).
Feb 9 '08 #7

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

Similar topics

3
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
6
by: francisco lopez | last post by:
ok , first of all sorry if my english is not so good, I do my best. here is my problem: I donīt know much javascript so I wrote a very simple one to validate a form I have on my webpage. ...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
18
by: Sender | last post by:
Yesterday there was a very long thread on this query. (You can search on this by post by 'sender' with subject 'Simple Problem' post date Oct 7 time 1:43p) And in the end the following code was...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
2
by: Vitali Gontsharuk | last post by:
Hi! I have a problem programming a simple client-server game, which is called pingpong ;-) The final program will first be started as a server (nr. 2) and then as a client. The client then...
8
by: rdrink | last post by:
I am just getting into pysqlite (with a fair amount of Python and MySQL experience behind me) and have coded a simple test case to try to get the hang of things... yet have run into a 'stock...
5
by: Chelong | last post by:
hey,the follow is the text file content ========================================apple====pear== one Lily 7 0 0 7 7 two Lily 20 20 6.6666 20 8 one Lily 0 10 2.85 4 0 two Lily 22 22 7.33326 2 5 ...
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
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
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.