(view)
string o2view_get_query(string $view_name, boolean $with_orderby, boolean $with_limit)
This function returns SQL query code generated by the view $view_name.
By default ORDER BY and LIMIT clauses are excluded from query: if you need to uinclude them too use specific parameters.
NOTE: Links unresolved as JOIN and calculated (formula) fields will not be included in SQL query code.