I need to extract data as follows:
SELECT d.* FROM WYISORG AS d, WYISCONTACT AS d1
WHERE
(d.ORGID=d1.ORGID)
AND
(d1.SURNAME LIKE \'%sample%\')
and then add to it data extracted as follows:
SELECT d.* FROM WYISORG AS d
WHERE
(d.ORGANIZATIONNAME LIKE \'%sample%\')\";
OR (d.BRIEF LIKE \'%sample%\')\";
Both of the queries work individual, but how do I put the two results together?
If I create a temporary table will that work when loads of people are accessing the same search, or might they get odd results (mysql)
Is there any way of doing the two queries together like (and this doesn\'t work):
SELECT d.* FROM WYISORG AS d, WYISCONTACT AS d1
LEFT OUTER JOIN d1 ON d.ORGID=d1.ORGID
WHERE
(d1.SURNAME LIKE \'%sample%\')
OR (d.ORGANIZATIONNAME LIKE \'%sample%\')
OR (d.BRIEF LIKE \'%sample%\')
Thankx
Elizabeth
SELECT d.* FROM WYISORG AS d, WYISCONTACT AS d1
WHERE
(d.ORGID=d1.ORGID)
AND
(d1.SURNAME LIKE \'%sample%\')
and then add to it data extracted as follows:
SELECT d.* FROM WYISORG AS d
WHERE
(d.ORGANIZATIONNAME LIKE \'%sample%\')\";
OR (d.BRIEF LIKE \'%sample%\')\";
Both of the queries work individual, but how do I put the two results together?
If I create a temporary table will that work when loads of people are accessing the same search, or might they get odd results (mysql)
Is there any way of doing the two queries together like (and this doesn\'t work):
SELECT d.* FROM WYISORG AS d, WYISCONTACT AS d1
LEFT OUTER JOIN d1 ON d.ORGID=d1.ORGID
WHERE
(d1.SURNAME LIKE \'%sample%\')
OR (d.ORGANIZATIONNAME LIKE \'%sample%\')
OR (d.BRIEF LIKE \'%sample%\')
Thankx
Elizabeth