Quoting Steve Kirkup <[EMAIL PROTECTED]>:
> I guess, I don't understand what the subquery is supposed to encompass.
> My SQL is basically
> SELECT * FROM Table INNER JOIN Sub_Table ON ( Table.id = Sub_Table.id )
> WHERE Table.id = '1'
> Does this mean I should drop the 'SELECT * FROM ' from the SQL in order
> to work?

The arbitrary SQL approach uses the SQL you want to execute as a sub-select
query. This way the normal column selecting, row limiting, paging and
other stuff still works. Consider this query:

SELECT me.* FROM (SELECT * FROM table) AS me;

Adding "rows" and "page" options to your search still works the same way
it would with a regular search - just by adding a LIMIT clause to the end:

SELECT me.* FROM (SELECT * FROM table) AS me LIMIT 15,20;

There might be other reasons to why its done the way it is :)

--Tobias

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to