[SOLVED] Query work on production but not on testing server
Posted: Mon Jul 31, 2006 3:22 am
feyd | Please use
Messy with the aliases I know, but i'm not the best with SQL anyhow, so anything to help me see how it works is always handy.
Anyhow ... on the production server, it returns a list of items:[/syntax]
But on the testing server it returns only:
It's probrably worth nothing that the desired output is that of the production server.
I guess at the end of the day I am just wondering if its a bad query which the older version is just allowing while the new version blocks the NULL values, or is the query OK and some other issue is at fault.
Either way, all assistance appreciated. Cheers
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I know, I know .... it's probrably a difference in mySQL version (5.0.20 on testing and 4.1.20 on production), either that or just plain old bad SQL (which I'm quite good at) - (making bad SQL not just good at SQL) - but I'm interested to hear any feedback on why this is, and if it should be done a different way to be compatible with both.
My query is:
[syntax="sql"]
SELECT `a1`.`VI_PK` , `a2`.`name` , `b2`.`VRI_PK`
FROM `tbl_vendor_recipe` `b1`
INNER JOIN `tbl_vendor_recipe_ingredients` `b2` ON ( `b1`.`VR_PK` = `b2`.`VR_ID` )
RIGHT OUTER JOIN `tbl_vendor_product` `a1` ON ( `b2`.`VI_ID` = `a1`.`VI_PK` )
INNER JOIN `tbl_master_items` `a2` ON ( `a1`.`MI_ID` = `a2`.`MI_PK` )
WHERE (
`a1`.`V_ID` = '8'
)
AND (
`a2`.`MT_ID` = '1'
)
AND (
`b1`.`VR_PK` = '286'
)
ORDER BY `a2`.`name`
Anyhow ... on the production server, it returns a list of items:[/syntax]
Code: Select all
211 Bacon NULL
212 Chicken NULL
213 Ham 508
214 Hot Salami NULL
215 Mild Salami NULLCode: Select all
213 Ham 508It's probrably worth nothing that the desired output is that of the production server.
I guess at the end of the day I am just wondering if its a bad query which the older version is just allowing while the new version blocks the NULL values, or is the query OK and some other issue is at fault.
Either way, all assistance appreciated. Cheers
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]