Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • SELECT
        second.*
    FROM
        second p,
        second k
    WHERE
        p.id = k.first_id

    Which row in second is the SELECT clause referring to?

    • Yeah, when you have ambiguities, you need to disambiguate. So? That's not the case in my example.

      And that's not what it complains about. It complains that it doesn't know of the table at all, not that it doesn't know which table I refer to.
      • Hmm, I don’t have PostgreSQL handy here to check; but I know that SQLite at least behaves just like MySQL. I’d be surprised, actually, if any RDBMS let you do what you were after.

        We can quibble about the wording of the error message; I’ll agree that it could be more plausible.

        I also won’t disagree at all that MySQL is a cardhouse of hack upon hack.

        But… I dunno, that behaviour there seems sensible to me.

        • Here's what Postgres says:

          ERROR: invalid reference to FROM-clause entry for table "first"
          HINT: Perhaps you meant to reference the table alias "f".