Hi,
I think I need to use an EXISTS query, but I am not vey proficient with
it and don't quite have a handle on the logic of this query yet.
query1, winners, has 3 fields that I'm concerend with
table2, players, has 1 field that I'm concerned with
they are linked with an ID.
I've already managed to get one part of my question answered. I had
the players table and the time table, and a simple query that combines
them so i can see the finishing times of each player.
Now what I need to do is get a query that displays the finishing times
only for the players that exist in each of the 3 fields of the winners
table.
example:
query1 (all players and their times - the * is to make it clearer later
in this msg)
playerid, time
1,5 *
2,7
3,4 *
4,9
5,3 *
6,8
winners table (each record is a new race - i want 1 race at a time)
first,second,third1
5,3,1
Because of the nature of my database (it's a bit more complex than I've
laid out here), I had to separate the winners from the times.
what I want to return is this query:
first time ,second time,third time
3, 4, 5
basically, the times of the 3 winners.
I'm having problems because it's not a simple 1-1, the times table is
laid out nicely, but the winners table is field based, not record
based.
any help would be appreciated and if possible explain it so I can learn
how to fish.
thx,
Bodi 2 1941
Try something like:
SELECT query1.* FROM query1
WHERE EXISTS
(SELECT winners.* FROM winners WHERE winners.first=query1.playerid OR
winners.second=query1.playerid OR winners.third=query1.playerid;);
"Jedi Knight" <az*****@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com... Hi,
I think I need to use an EXISTS query, but I am not vey proficient with it and don't quite have a handle on the logic of this query yet.
query1, winners, has 3 fields that I'm concerend with table2, players, has 1 field that I'm concerned with they are linked with an ID.
I've already managed to get one part of my question answered. I had the players table and the time table, and a simple query that combines them so i can see the finishing times of each player.
Now what I need to do is get a query that displays the finishing times only for the players that exist in each of the 3 fields of the winners table.
example: query1 (all players and their times - the * is to make it clearer later in this msg) playerid, time 1,5 * 2,7 3,4 * 4,9 5,3 * 6,8
winners table (each record is a new race - i want 1 race at a time) first,second,third1 5,3,1
Because of the nature of my database (it's a bit more complex than I've laid out here), I had to separate the winners from the times.
what I want to return is this query: first time ,second time,third time 3, 4, 5
basically, the times of the 3 winners.
I'm having problems because it's not a simple 1-1, the times table is laid out nicely, but the winners table is field based, not record based.
any help would be appreciated and if possible explain it so I can learn how to fish.
thx, Bodi
Try something like:
SELECT query1.* FROM query1
WHERE EXISTS
(SELECT winners.* FROM winners WHERE winners.first=query1.playerid OR
winners.second=query1.playerid OR winners.third=query1.playerid;);
"Jedi Knight" <az*****@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com... Hi,
I think I need to use an EXISTS query, but I am not vey proficient with it and don't quite have a handle on the logic of this query yet.
query1, winners, has 3 fields that I'm concerend with table2, players, has 1 field that I'm concerned with they are linked with an ID.
I've already managed to get one part of my question answered. I had the players table and the time table, and a simple query that combines them so i can see the finishing times of each player.
Now what I need to do is get a query that displays the finishing times only for the players that exist in each of the 3 fields of the winners table.
example: query1 (all players and their times - the * is to make it clearer later in this msg) playerid, time 1,5 * 2,7 3,4 * 4,9 5,3 * 6,8
winners table (each record is a new race - i want 1 race at a time) first,second,third1 5,3,1
Because of the nature of my database (it's a bit more complex than I've laid out here), I had to separate the winners from the times.
what I want to return is this query: first time ,second time,third time 3, 4, 5
basically, the times of the 3 winners.
I'm having problems because it's not a simple 1-1, the times table is laid out nicely, but the winners table is field based, not record based.
any help would be appreciated and if possible explain it so I can learn how to fish.
thx, Bodi This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Juho Saarikko |
last post by:
I made a Python script which takes Usenet message bodies from a database,
decodes uuencoded contents and inserts them as Large Object into a
PostGreSQL database. However, it appears that the to...
|
by: netpurpose |
last post by:
I need to extract data from this table to find the lowest prices of
each product as of today. The product will be listed/grouped by the
name only, discarding the product code - I use...
|
by: Andreas Lauffer |
last post by:
I changed from Access97 to AccessXP and I have immense performance
problems.
Details:
- Access XP MDB with Jet 4.0 ( no ADP-Project )
- Linked Tables to SQL-Server 2000 over ODBC
I used...
|
by: Brian Oster |
last post by:
After applying security patch MS03-031 (Sql server ver 8.00.818) a
query that used to execute in under 2 seconds, now takes over 8
Minutes to complete. Any ideas on what the heck might be going...
|
by: Mike Chamberlain |
last post by:
Hi all.
I'm trying to extend the Microsoft Enterprise Library Data Access
Application Block
(http://msdn.microsoft.com/library/en-us/dnpag2/html/daab.asp?frame=true)
to work with a Borland...
|
by: Jedi Knight |
last post by:
Hi,
I think I need to use an EXISTS query, but I am not vey proficient with
it and don't quite have a handle on the logic of this query yet.
query1, winners, has 3 fields that I'm concerend...
|
by: pbd22 |
last post by:
Hi.
I need some help with structuring my query strings.
I have a form with a search bar and some links. Each
link is a search type (such as "community"). The HREF
for the link's anchor looks...
|
by: creative1 |
last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
|
by: chromis |
last post by:
Hi there,
I've been reading an OOP book recently and it gives some nice Adaptor / Template patttern code to wrap around the php Mysql functions. I thought that I'd try and create a Simple Address...
|
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
|
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...
|
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...
|
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: 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,...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
| |