|
Posted by Ethilien on 10/13/05 06:43
Hmmm,
"/SELECT .* FROM (.*) WHERE (.*) ORDER BY .*/Ui", "SELECT count(*) FROM
\$1 WHERE \$2"
Might work, but haven't tried it...
Guy Brom wrote:
> Can anyone suggest the correct regex to replace col1,col2... with count(*)
> and strip out everything just before ORDER BY?
>
> so for this:
> SELECT col1,col2... FROM tbl WHERE filter1 filter2 ORDER BY order1,order2
>
> I would get this:
> SELECT count(*) FROM tbl WHERE filter1 filter2
>
> Thanks!
[Back to original message]
|