Hi there, I need your appreciated help.
I working with MySQL and ASP Classic server-side language.
This is my queries execute in the ASP script:
Query #1:
SELECT * FROM
tbl_www
WHERE 1
AND CO LIKE '%MD%'
AND myDate = '2011-10-06'
ORDER BY myDate DESC
If I have rows valid I need join the tbl_www
with other two tables mysql to get more optional information; this is the query Join:
Query #2:
SELECT
A.CO
, A.LINES
, CA.FCN
, CA.FGR
, CB.Pro
, CB.Aut
, CB.Ric
FROM
tbl_www A
JOIN tbl_xxx CA ON CA.LINES = A.LINES
JOIN tbl_yyy CB ON CB.LINES = A.LINES
WHERE 1
AND A.CO LIKE '%MD%'
AND myDate = '2011-10-06'
ORDER BY myDate DESC
I need always see the rows of query #1 and see more optional information with Query #2 but the problem occurs when in an individual tables joined the field LINES is not equivalent.
For example if I use in my ASP script only Query #2 and in the join the field LINES is not equivalent I don’t see the rows valid returned of query #1.
The question is, can simplify the double passage and queries of the server-side language with a single sql query, considered as explained above?
Thanks in advance, cheers—