Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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


In reply to (OT) MySQL select Question by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-16 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found