in reply to Anything Else Like SQL::Statement?

  1. Last I checked, S::S didn't support subqueries (tho jZed, S::S's keeper, recently intimated that someone was picking up that particular gauntlet, so there may be something in the works)

  2. I *think* /*..*/ comments should work; I gave jZed a patch to support them awhile ago, and I think I'm supporting it in DBD::Amazon.

  3. S::S doesn't yet support CASE clauses. There's a simple DECODE(), but that probably doesn't address your query's needs

BTW: perhaps a <readmore> is in order ?

If you're feeling frisky, you can take a stab at adding support for all the above. I've been trying to find time to do it (along with better JOIN support, and some predicate optimizer code from DBD::Amazon), but as always, time is a rare commodity.

As it turns out, I may need to implement some of these myself RSN, esp. for DBD::eBay, so hopefully some of these may happen in the next few months.

While there are numerous modules for parsing SQL in various forms, and some that purport to translate SQL between DBMS's, I'm not aware of any others that implement a relational engine.

Correction:

I think my comments patch was for ANSI style i.e.,

select * -- this is an ANSI SQL comment from mytable
That being said, the OP SQL isn't likely to sail thru S::S, w/ or wo/ comments.