Can anyone help me on this? I have a SELECT statement that is not working correctly and I don't know how to fix it.
Here is some information on my database with only the fields in question listed.
Table: designers - and the fields are designerid, name
Table: magazines - and the fields are magid, magnameid
Table: magname - and the fields are magnameid, magname
Table: patterns - and the fields are title, designerid,magid,stitchcount,notes
Here is my statement:
SELECT patterns.title, designers.name, patterns.stitchcount, patterns.picture, patterns.notes
FROM patterns, designers, magname, magazines WHERE patterns.magid=6 AND patterns.designerid = designers.designerid AND magname.magnameid = magazines.magnameid AND magazines.magid = patterns.magid ORDER BY title ASC";
The problem I am having is when there is more than one design in the same issue of a magazine (magid is the id number for the magazine issue). If there are two designs by the same designer (designerid) then, only one of them is shown.
If I remove the references to the designer, then everything is okay, except, with this one, no information about the designer is given and I want the designer's name to appear in the results. Here is that statement:
SELECT patterns.title, patterns.stitchcount, patterns.picture, patterns.notes FROM patterns, magname, magazines WHERE patterns.magid=6 AND magname.magnameid = magazines.magnameid AND magazines.magid = patterns.magid ORDER BY title ASC";
Can anyone help me figure out the correct select statement so that i get ALL the issues in a specific magazine even if a designer has more than one design in it?
(oh, and if you're curious -my database is an index of designs from cross-stitch magazines 🙂 )