URGENT help please - need to limit results with multi table join

URGENT help please - need to limit results with multi table join

Post by Mr H » Mon, 20 Aug 2001 14:09:47



Hello,
I've posted to other groups, but I don't get any replies for this problem! I
wonder if anyone could help here.  If people think it's not possible, then
please say! at least I will know.

Okay, I have two tables (for example), with a one to many relationship.

TABLE helpers
ID (primary key)
Firstname
Lastname

TABLE helpareas
areaID (Primay Key)
ID (Foreign Key)
Description

My select query would go something like:
SELECT firstname, lastname, description
FROM helpers, helpareas
WHERE helpers.ID = helpareas.ID

Now, because I could have different numbers of rows in helpareas, I can't
simply put a LIMIT on the rows. So if I want to select only the first 10
helpers, I can't put LIMIT at the end because it would only retrieve the
first 10 joined rows.  So, is there any way of overcoming this? What about
telling my anywhere else to look? ANYTHING would be appreciated!

P.S. I'm restricted to using mySQL (for now), so subqueries are out of the
question.

Thanks in advance,

Michael

 
 
 

1. HELP PLEASE: URGENT: Need help forming a multi table query

Hello,

I'm using SQL SERVER 7.0. I'm very new to Multi-Table querying, and
can't seem to figure this one out. Any help would be appreciated.

I have 2 tables. one is called RATES and one is called BILLING

In the BILLING table, there are 2 columns, one is COUNTRY and
the other is ACTUAL.  In the RATES table, there are two columns
COUNTRY (which you would use to match the rate to) and RATE.

This is for an ASP page. It has to go row by row of the BILLING
table and calculate the total of a phone call, by multiplying the
ACTUAL of BILLING column with the RATE for that COUNTRY.
It sounds simple, but I get strange (wrong) results everytime.

Any help would be appreciated.  Thanks in advance.

Ayaz Asif

2. Please Read ! Beta testing for N.L. Interface for RDBMS

3. need help please:joined tables,add new entries based on one table columns

4. CBT for VB?

5. How to?: Use a disconnected recordset to populate a table in another DB

6. Batching results from a Multi-table join

7. Preventing execution stop

8. Limiting the number of records in a query (Urgent - please help)

9. Result Sets easy one I need help need Asap Please guys

10. Returning Result from a Dynamic SQL Statement URGENT Please Help :-)

11. Help with Left Join - Urgent Please