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

Mysql and Outer Joins

I am new to mysql, but have experience of a number of other databases
and I am somewhat confused by an outer join issue.

Given the following data structure

TABLE: handset_features
Feature Description
WEIGHT Weight in Grammes
COLOUR Colour Screen
WAP Wap Enabled
BLUET Bluetooth
TABLE: model_features
Model Feature Value
NOK-3300 COLOUR YES
NOK-3300 WAP YES
NOK-7250 COLOUR YES
NOK-7250 WAP YES
NOK-7250 BLUET NO
What I wanted to achieve was for a given model to retrieve all
possible
features and the value of that feature if the value was set.
e.g. for the NOK-3300
EXPECTED RESULT:
Feature Description Value
WEIGHT Weight in Grammes <null>
COLOUR Colour Screen YES
WAP Wap Enabled YES
BLUET Bluetooth <null>

This was the SQL that I believed should do the job and indeed does on
other
database engines.

SELECT hf.description,
mf.value
FROM handset_features AS hf LEFT OUTER JOIN
model_features AS mf ON hf.feature = mf.feature
WHERE mf.model = "NOK-3300";
Unfortunately with mysql this does not work and only returns me the
rows
where a record already exists in model_features. i.e. It appears to
ignore
the outer and do a hard join. This is the result set I get back

Feature Description Value
COLOUR Colour Screen YES
WAP Wap Enabled YES
Does anyone have any ideas what I am doing wrong?
Jul 19 '05 #1
0 1384

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: aaron | last post by:
I have a question about (i think) joining. If I have a table in a database that has this info: key - name - favorite 1 - john - 2 2 - judy - 3 3 - joe - 1 the favorite icecream...
0
by: Steve Weet | last post by:
I am new to mysql, but have experience of a number of other databases and I am somewhat confused by an outer join issue. Given the following data structure TABLE: handset_features Feature ...
1
by: JBBHF | last post by:
Hi i'm working on a web project, and i would like to make my oracle query work in mysql. select match.numero "nummatch", to_char(match.datematch, 'yyyy-MM-dd') "datematch", p1.numjoueur "j1",...
2
by: Martin | last post by:
I am now working on SQL Server 2000 having had previous experience on a different database. Both of the OUTER JOIN syntaxes is different from what I am used to and I am finding it slightly...
8
by: Matt | last post by:
Hello I have to tables ar and arb, ar holds articles and a swedish description, arb holds descriptions in other languages. I want to retreive all articles that match a criteria from ar and...
1
by: deepak.rao | last post by:
Hi, I have to run the following statement in MySQL. (The script is generated from oracle). ************* SELECT t1.c1, t2.c2, t3.c3 from t1, t2, t3 where t1.flag = 1 and (t1.cx = t2.cx(+)...
7
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins"...
4
by: Anthony Robinson | last post by:
I was actually just wondering if someone could possibly take a look and tell me what I may be doing wrong in this query? I keep getting ambiguous column errors and have no idea why...? Thanks in...
3
by: Ian Boyd | last post by:
i know nothing about DB2, but i'm sure this must be possible. i'm trying to get a client to create a view (which it turns out is called a "Logical" in DB2). The query needs a LEFT OUTER JOIN, but...
3
by: deko | last post by:
From what I understand, an Inner Join narrow the rows selected to the table with the least results... and an Outer Join does the opposite... SELECT qryTxToQ1.Q1Total, qryTxToQ2.Q2Total,...
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...
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...
0
marktang
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
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 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.