Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I'm really sorry for asking a non Perl question here, but i'm totally stuck and have nowhere else to go. If someone can suggest a good MySQL forum i'd love to know?
My question is:
I want to do a reletively simple select I think, something like this, except this doesn't work, so I need the correct syntax. I think I might have to use the JOIN, but I don't really know what that is either, my SQL is a bit dodgy to say the least! :-)
This doesn't work:
select * from table1 where table1.category = 1 OR table1.category = (s +elect table2.id from table2 where table2.parent_id = 1)
Can anyone suggest a way to make this work? I want to select all fields from table1 where either table1.category = 1 OR where table2.parent_id = 1, but I can't seem to find a way to do this.........
Many thanks, and if it helps to justify this question being posted on this forum, I am writing everything using the Perl DBI module, which is totally excellent!!!! :-)
Cheers,
Tom