$lim->{order_by_middle},
) if $offset;
- $sql = sprintf ('SELECT TOP %u %s FROM ( %s ) %s %s',
- $rows,
+ $sql = sprintf ('SELECT %s FROM ( %s ) %s %s',
$lim->{selection_outer},
$sql,
$lim->{quoted_rs_alias},
) if $offset;
- $sql = sprintf ('SELECT %s FROM ( %s ) %s %s FETCH FIRST %u ROWS ONLY',
+ $sql = sprintf ('SELECT %s FROM ( %s ) %s %s',
$lim->{selection_outer},
$sql,
$lim->{quoted_rs_alias},
$lim->{order_by_requested},
- $rows,
) if $offset and (
$lim->{order_by_requested} or $lim->{selection_middle} ne $lim->{selection_outer}
);
FETCH FIRST 2 ROWS ONLY
) me
ORDER BY $ord_set->{order_req}
- FETCH FIRST 2 ROWS ONLY
)",
[ [ { sqlt_datatype => 'varchar', sqlt_size => 100, dbic_colname => 'source' }
=> 'Library' ] ],
FETCH FIRST 2 ROWS ONLY
) me
ORDER BY ORDER__BY__1
- FETCH FIRST 2 ROWS ONLY
) me
JOIN owners owner ON owner.id = me.owner
WHERE ( source = ? )
is_same_sql_bind(
$books_45_and_owners->search ({}, {order_by => $ord_set->{order_by}})->as_query,
- "(SELECT TOP 2
- id, source, owner, price, owner__id, owner__name
+ "(SELECT id, source, owner, price, owner__id, owner__name
FROM (
SELECT TOP 2
id, source, owner, price, owner__id, owner__name$o_sel
$books_45_and_owners->search ({}, { group_by => 'title', order_by => 'title' })->as_query,
'(SELECT me.id, me.source, me.owner, me.price, owner.id, owner.name
FROM (
- SELECT TOP 2 id, source, owner, price, ORDER__BY__1 AS title
+ SELECT id, source, owner, price, ORDER__BY__1 AS title
FROM (
SELECT TOP 2
id, source, owner, price, ORDER__BY__1