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

  • Home
  • SEARCH
  • 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 6823201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:45:17+00:00 2026-05-26T21:45:17+00:00

select test.*, user.*, count(test_stats.test_public_id) as past_day_views, test_stats.test_public_id from test join user join test_stats where

  • 0
select test.*, 
       user.*,
       count(test_stats.test_public_id) as past_day_views,
       test_stats.test_public_id   
  from test 
  join user
  join test_stats
 where test.user_id=user.user_id 
   and test.test_public_id=test_stats.test_public_id
   and test_stats.updated_on > DATE_SUB(CURDATE(), INTERVAL 1 DAY)
 group by test_stats.test_public_id
 order by title

select count(test_public_id) as total_views
  from test_stats
 where test_public_id ='$tourid'

These query for last week views retrieve as i don’t much about again asking for this queries
Please do me this favor also

select count(ms.test_public_id) as total_views, ms1.recent_views from test_stats ms
join (select count(test_stats.test_public_id) as recent_views from test_stats
where test_stats.test_public_id = '$tourid' and test_stats.updated_on > DATE_SUB(CURDATE(), INTERVAL 7 DAY)) ms1 where ms.test_public_id ='$tourid'

SELECT * FROM user WHERE activation = '0' AND user_id >1

select * from test where user_id ='$user_id' and test.url is not null
  • 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-26T21:45:18+00:00Added an answer on May 26, 2026 at 9:45 pm

    Your JOINS/WHERE is fundamentally incorrect. I will fix that. But in your model, create a function that does this:

    class MyModel extends Zend_Db_Table_Abstract
    {
        // ...
        public function getSomeData()
        {
            $cols = array(
                'test.*',
                'user.*',
                'count(test_stats.test_public_id) as past_day_views',
                'test_stats.test_public_id'
            );
            $select = $this->select()
                ->setIntegrityCheck(false)
                ->from('test', $cols)
                ->join('user', 'user.user_id = test.user_id', array())
                ->join('test_states', 'test_stats.test_public_id = test_stats.test_public_id', array())
                ->where('test_stats.updated_on > DATE_SUB(CURDATE(), INTERVAL 1 DAY)')
                ->group('test_stats.test_public_id')
                ->order('title');
    
            return $this->fetchAll($select);
        }
    

    And now for the second query:

    $select = $this->select()
        ->from('test_stats', array('count(test_public_id) AS total_views'))
        ->where('test_public_id = ?', $tourid);
    
    return $this->fetchAll($select);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query: SELECT * FROM sample INNER JOIN test ON sample.sample_number =
I have 2 tables, using an inner join to query them. SELECT COUNT(table2.id) FROM
query 1 : this will count all the record with email 'emali@test.com' select count(*)
Consider this T-SQL: CREATE USER my_test_user WITHOUT LOGIN; SELECT USER_NAME(), USER, SUSER_SNAME(),SYSTEM_USER, suser_name(); EXECUTE
In postgres you can do a comparison against multiple items like so: SELECT 'test'
When I run the this select '$(''test'')' in SQL Management Studio 2008 it returns
In an Oracle 10 database, I did a small test: SELECT REGEXP_REPLACE('İF', '[Iİ]F', 'DONE',
I want to create a SQL Select to do a unit test in MS
I have the following test-code: CREATE TABLE #Foo (Foo int) INSERT INTO #Foo SELECT
i have following filteringselect: <select name=v dojoType=dijit.form.FilteringSelect valueList=v id=v value=0><option value=></option><option value=0>0-test</option><option value=1>1-test2/option><option value=2>2-test3</option><option

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.