close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Self Join - To use a repeat region in recordset

Thread began 12/27/2020 5:58 am by msbannister373603 | Last modified 12/30/2020 9:18 am by msbannister373603 | 1059 views | 6 replies

msbannister373603

Self Join - To use a repeat region in recordset

Originally Said By: Ray Borduin
  I need to understand your database structure better to help write the correct query and make sure I'm leading you down the correct path.

What does the Games table have in it? It looks like it already has an oppo1 and oppo2... so what do you get with just select * from games?

I think if I understand the columns in the games table better then I can probably help you write the correct query.  


Yes the Games table does have oppo1 and oppo2. I figured out a workaround so I don't have to use the join. However, I did really close. I'm trying to make all the gameID be on the same row as the team. The GameIDs are separate entries into the database so I'm having trouble grouping them as a team. I need to group the gameID on the same row and show entries also where gameID is null. Here is what I'm getting using this join:

SELECT DISTINCT ME.gameID, ME.teamID, E.oppo1, ME.oppo2
FROM games ME
INNER JOIN games E
ON ME.teamID = E.teamID AND ME.oppo2 < E.oppo1

Game ID TeamID Oppo1 Oppo2
186 218 Trigg County Boston Celtics
187 219 Tates Creek Paris Western


This is the output I'm looking for. I have another team in the database. Team 217. Team 217 oppo2 is null. Therefore, the query I'm looking for should produce this:

Game ID TeamID Oppo1 Oppo2
186 218 Trigg County Boston Celtics
187 219 Tates Creek Paris Western
188 217 Maysville

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...