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 8558673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:51:56+00:00 2026-06-11T15:51:56+00:00

The following query gives me a one row result Select Sum(Actions) From ( Select

  • 0

The following query gives me a one row result

Select Sum(Actions) From
(
    Select
        Count(t.Create_Dtime) As Actions
    From Player_Tapjoy T 
           Inner Join Player_Source S 
               On (T.Player_Id = S.Player_Id)
           Inner Join Feature_Group_Xref F
          On (S.Group_Id=F.Group_Id 
              And F.Feature_Name ='Try     BC') 
     Where Trunc(t.Create_Dtime) = To_Date('2012-sep-17','yyyy-mon-dd')
     Union All
     Select 
         Count(a.Create_Dtime) As Actions
     From Player_Aux_Pt A 
         Inner Join Player_Source S  
              On (A.Player_Id = S.Player_Id)
         Inner Join Feature_Group_Xref F
          On (S.Group_Id=F.Group_Id 
               and f.feature_name =     'TryBC')
    Where A.Site = 'AppCircle' 
    And Trunc(A.Create_Dtime) = To_Date('2012-sep-17','yyyy-mon-dd')
 )

I now want to add in a constraint to the result where: only users that have created an account before Sep 12,2012.

In my database language: only users that have a trunc(create_dtime) < To_Date('2012-sep-12','yyyy-mon-dd') . This trunc(create_dtime) date comes from the player table.

Could I map this player table to the current table by using another inner join?

  • 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-06-11T15:51:57+00:00Added an answer on June 11, 2026 at 3:51 pm

    Your requirement isn’t completely clear and obviously I have had to guess about your data model. I’m assuming the Player table has one row per Player_Id i.e. it is the primary key end of foreign key relationships to the tables you’re querying.

    I have changed the inner query so it just returns a set of rows rather than aggregations. Then I join the inline view (aliased q) with the Player table and use a COUNT() rather a SUM() to get the figure.

    Select count(Player_Id) From
    (
        Select
            T.Player_Id
        From Player_Tapjoy T 
               Inner Join Player_Source S 
                   On (T.Player_Id = S.Player_Id)
               Inner Join Feature_Group_Xref F
              On (S.Group_Id=F.Group_Id 
                  And F.Feature_Name ='Try     BC') 
         Where Trunc(t.Create_Dtime) = To_Date('2012-sep-17','yyyy-mon-dd')
         Union All
         Select 
             A.Player_Id 
         From Player_Aux_Pt A 
             Inner Join Player_Source S  
                  On (A.Player_Id = S.Player_Id)
             Inner Join Feature_Group_Xref F
              On (S.Group_Id=F.Group_Id 
                   and f.feature_name =     'TryBC')
        Where A.Site = 'AppCircle' 
        And Trunc(A.Create_Dtime) = To_Date('2012-sep-17','yyyy-mon-dd')
     ) q
     join player p
          on (p.Player_Id = q.Player_Id)
     where Trunc(p.Create_Dtime) < To_Date('2012-sep-12','yyyy-mon-dd')
    

    This may not be the exact result you need, for the reasons I gave at the top, but it should point you in the right directon.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given following Statment: String query = "Select * from T_spareParts where SparePartPK IN (?
I have the following query: ;WITH valRules AS ( SELECT vr.valRuleID, Count(*) AS totalRows,
I am having trouble writing a query to select one row per date, given
I have the following query: $sqltext = SELECT Score FROM HighScore . WHERE fbID='$_POST[fbID]'
I have the following query which gives me the right results. But it's super
Given a query like the following: DELETE FROM FOO WHERE ID in (1,2,3,4,....); Is
Following query is used for Getting Categories and one news for each category. How
I'm trying to perform the following query using MySQL: SELECT e.event, BINARY e.params as
I have a query where I am only interested in the row count, however
On my database when i do this query: SELECT * FROM users u LEFT

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.