It's not as elegant as I wanted I got it to work this way (I must be
getting tired)
create temporary table projects_need
SELECT proj
, count(rsrc) as rsrc_count
FROM project
group by proj;
CREATE temporary table suppliers_match
select p.proj
, s.name
, count(s.name) a
et (0.00 sec)
-Original Message-
From: Laszlo Thoth [mailto:[EMAIL PROTECTED]
Sent: Friday, October 01, 2004 10:53 AM
To: [EMAIL PROTECTED]
Subject: matching people with projects via resources
I'm having difficulty constructing a query. I've got two kinds of
information:
a table
[snip]
You haven't stated the resources required for the project in the query.
Try this ...
SELECT project.proj, project.rsrc, people.name
FROM project LEFT JOIN
people ON project.rsrc=people.rsrc
WHERE project.rsrc = 'wood'
AND project.rsrc = 'canvas'
Not tested, but limits people to thos who h
Hi Laszlo,
This is sort of a butchery, and might be a little nicer with two queries
and a temp table, but this works in mysql 4.1.3-beta (at least, it did
for me).
SELECT A.name, B.proj
FROM people as A, project as B
WHERE A.rsrc=B.rsrc
GROUP BY A.name, B.proj
HAVING COUNT(*)=(SELECT COUNT(*) FR
[snip]
I'm pretty sure this is a good starting point, but that's just matching
resource
to resource without excluding Lincoln from building an Ark (no canvas).
mysql> SELECT project.proj,project.rsrc,people.name FROM project LEFT
JOIN
people ON project.rsrc=people.rsrc;
+--+-+-
I'm having difficulty constructing a query. I've got two kinds of information:
a table of resources that various people have, and a table of resources that
various projects need.
===
CREATE TABLE `people` (
`name` varchar(11) default NULL,
`