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

MYSQL Inner Join with possible empty tables

Hi everyone,

I am using the following query to retrieve member profile data:

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM Members 
  2.                             INNER JOIN MemberMartialArts on MemberMartialArts.mma_memberId = '$memberId'
  3.                             INNER JOIN MemberAbilities on MemberAbilities.ma_memberId = '$memberId'
  4.                              WHERE m_id = '$memberId'
  5.  
My problem is the tables, MemberMartialArts and MemberAbilities may possibly have no records where memberId = '$memberId'.

I do not want to use three separate queries because as tested the speed was slower.

Can anyone comment how I can modify this query to to make it work even of one of the table do not contain a memberId..

Thanks,
Joe
Nov 28 '10 #1
2 3080
yarbrough40
320 100+
what you want are outer joins as opposed to "inner"

I knew a Joe Deluca back in high school in Ohio... No chance is there?
Nov 29 '10 #2
Thanks man that did the trick.

And no I'm from Canada ;)
Nov 29 '10 #3

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

Similar topics

0
by: B. Fongo | last post by:
------=_NextPart_000_0011_01C36322.2FEF5DC0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable It works!=20 SELECT Customers.Name, Customers.City,...
3
by: Ike | last post by:
Oh I have a nasty query which runs incredibly slowly. I am running MySQL 4.0.20-standard. Thus, in trying to expedite the query, I am trying to set indexes in my tables. My query requires four...
11
by: news-east.earthlink.net | last post by:
The scenario: two tables CustomerTable --------------- CustomerID OrderID CustomerName CustomerEmail
1
by: GrungyApe | last post by:
I am new to this type of query and while I've found a lot of help on the forums, I am simply not getting it to work. Here is my attempt currently: SELECT DISTINCT(VADR.SUBSCRIBER_ID),...
4
by: Nathan | last post by:
I have an application that uses an Access database to gather information on students' test scores. In the database there are three tables which are joined by one- to-many relationships: ...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
1
by: eyedea | last post by:
Perform an inner join on tables BOOKS and SOURCES. Find the source cities for publisher_name "Random House" using the LIKE command to restrict record selection. This is my problem i need to solve, i...
2
by: kjewell23 | last post by:
Hello. I'm trying to inner join two tables into one dataset. Is that possible. If so I do I do it. I have my code down below, so if you could help me. please!! I'm using asp.net for my coding Dim...
1
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have a DataSet with 2 tables. Now I want to select data like a INNER JOIN from these tables. In SQL Syntax I would write: SELECT * FROM table1 t1 INNER JOIN table2 t2 ON t1.f1 =...
4
guillermobytes
by: guillermobytes | last post by:
hi, i was wondering which type of join should i use to get an empty result set when there is no record in one of the tables i.e : i have two tables : Element and Attribute the table Element...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
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...
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.