Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6377183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:50:21+00:00 2026-05-25T01:50:21+00:00

I would like to translate this MySQL query to the Zend format: SELECT count_panne,

  • 0

I would like to translate this MySQL query to the Zend format:

SELECT count_panne, mvt, nextHost, dtmvt, stat  
FROM ( SELECT COUNT(myTable.snMCB) AS count_panne,  
        myTable.mvt,  
        myTable.nextHost,  
        myTable.dtmvt,  
        myTable.stat  
    FROM myDB.myTable myTable  
    WHERE (myTable.dtmvt = calendar__gregorian__today__)  
      AND (myTable.statut = 'NOOK')  
    GROUP BY myTable.snMCB) AS myTempTable  
 WHERE count_panne > 2  
 ORDER BY count_panne DESC   

(ps: That’s a correct mysql sentence with modifs)

I tried the following with Zend:

$subSelect = $dbTable->select()  
    ->from($dbTable,array(
        'COUNT(myTable.snMCB) AS count_panne',
        'myTable.mvt',
        'myTable.nextHost',
        'myTable.dtmvt',
        'myTable.nextHost'))
    ->where("myTable.dtmvt BETWEEN '$dateDeb' AND '$dateFin'")
    ->where('myTable.stat = ?', 'NOOK')
    ->group('myTable.snMCB')
    ;

$select = $dbTable->select()
    ->setIntegrityCheck(false)
    ->from(new Zend_Db_Expr($subSelect),
            array('count_panne',
                'mvt',
                'nextHost',
                'dtmvt',
                'statut'))
    ->where('count_panne > 2')
    ->order('count_panne DESC')
    ;

It didn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:50:22+00:00Added an answer on May 25, 2026 at 1:50 am

    Have you tried doing this using the db adpater direct with sql as in…

        $db = $this->getAdapter();
    
    $query = $db->prepare("SELECT count_panne, mvt, nextHost, dtmvt, stat  
                           FROM ( SELECT COUNT(myTable.snMCB) AS count_panne,  
                                 myTable.mvt,  
                                 myTable.nextHost,  
                                 myTable.dtmvt,  
                                 myTable.stat  
                            FROM myDB.myTable myTable  
                           WHERE (myTable.dtmvt = calendar__gregorian__today__)  
                             AND (myTable.statut = 'NOOK')  
                           GROUP BY myTable.snMCB) AS myTempTable  
                           WHERE count_panne > 2  
                        ORDER BY count_panne DESC");
    
            $query->execute();
            return $query->fetchAll();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to translate a query like this one: FROM Entity_1 obj WHERE
i would like to translate this request in LINQ to SQL: SELECT * from
I would like to verify for myself how this MySQL string is translated by
I would like to translate or 301-redirect urls such as: www.domain.com/example.html to www.domain.com/example Here
I've got some code which I would like to translate into Opengl ES. I'm
I would like to translate the following Unix 1 Liner to PowerShell. Synopsis of
I have an app which shows html files from assets folder. I would like
I would like to add stuff out of an array and translate them. However,
I would like to know how to translate the following code to codebehind instead
I would like to build a web interface to present logdata. This should be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.