Let me simply add to the request (then I'll try to go work up a solution);
handle lisp-ish parenthetical indentations ...

select
  biz,
  avg( baz ),
  concat( boz,
          concat( bip,
                  dip
                ),
          doo
        ) as woa,
  lim
from
  ( a1,
    a2
  ) left join ( b1,
                b2
              )
    on a1.id = b1.id
where
  a1.id = a2.oid
and
  b1.id = b2.oid
and
  a1.other = 'foo'
order by
  etc asc,
  etc desc

On Tue, 17 Jul 2001, Andy Bach wrote:

> Hi Folks,
>
> I got a request of sorts to pretty print SQLs (ugly print I think but
> ...) in the format:
>      select
>         biz,
>         baz,
>         boom
>      from
>         ding,
>         dang
>      where
>         zz = yy
>      and
>         pp = zz
>     order by
>         baz
>
> and I thought; perl, BN, Parse:RecDescent ... FWP!!
>
> Any hints? Golf?
>
> a
>
> Andy Bach, Sys. Mangler
> Internet: [EMAIL PROTECTED]    VOICE: (608) 264-5178 ex 5738, FAX 264-510
>
>             So, the Buddha walks into a pizza parlor and says,
>                   "Make me one with everything."
>

-- 
 o ~   ~   ~   ~   ~   ~  o
/ Aaron J Mackey           \
\  Dr. Pearson Laboratory  /
 \ University of Virginia  \
 /  (434) 924-2821          \
 \  [EMAIL PROTECTED]    /
  o ~   ~   ~   ~   ~   ~  o


Reply via email to