Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-19-2007, 11:47 AM
walrus_ro's Avatar
Junior Member
 
Join Date: Nov 2007
Posts: 1
Exclamation Zend_Db_Select Subquery

Hello,

I'm some kind newbie in zend framework but I need to know if I can do this:

I have a query like this:

SELECT
tmp.x,
tmp.y
FROM
(
SELECT a as x, b as y FROM table_a WHERE ... GROUP BY ...
) AS tmp
WHERE
........
GROUP BY
.......


I use Zend_DB_Select to build this quey, but I can't include that subquery in my build.

This is the php code I use (where $select is the Zend_Db_Select object)

$tmp_table = "SELECT a as x, b as y FROM table_a WHERE ... GROUP BY ...";

$select->from(array('tmp' => $tmp_table), "x");
$select->from(null, "y");
.................


Please let me know if anyone made something like this, or how U solve this type of queryes with Zend_Db

Thank you,
and excuse my english.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:40 PM.