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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:58:45+00:00 2026-06-11T16:58:45+00:00

I have the below query: –Total DLs– select sum(DLs) as DLs_Total From ( Select

  • 0

I have the below query:

--Total DLs--
select sum(DLs) as DLs_Total
From
 (
Select
Count(T.Create_Dtime) As Dls
From Player_Tapjoy T 
Inner Join Player P On T.Player_Id=P.Player_Id
Where P.ReferredBy IS NULL
Union All
Select
Count(Pt.Create_Dtime) As DLs
From Player_Aux_Pt Pt
Inner Join Player P On Pt.Player_Id=P.Player_Id
Where
Pt.Site = 'AppCircle'
And P.ReferredBy IS NULL
)

I’m going to run this report twice, once for “And P.ReferredBy is Null”, and once for “And P.ReferredBy is NOT Null”.

I feel like this may be a good time to switch over to case queries…so if in the case of null or not null, one query will produce two separate results?

  • 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-11T16:58:46+00:00Added an answer on June 11, 2026 at 4:58 pm

    Yes, you can use case here. I have not tested the following query, but please check see if it works:

    --Total DLs--
    select sum(DLs_ReferredBy_Null) as DLs_ReferredBy_Null_Total, sum(DLs_ReferredBy_NotNull) as DLs_DLs_ReferredBy_NotNull_Total
    From
     (
    Select
    Count(CASE WHEN P.ReferredBy IS NULL THEN T.Create_Dtime END) As DLs_ReferredBy_Null,
    Count(CASE WHEN P.ReferredBy IS NOT NULL THEN T.Create_Dtime END) As DLs_ReferredBy_NotNull
    From Player_Tapjoy T 
    Inner Join Player P On T.Player_Id=P.Player_Id
    Union All
    Select
    Count(CASE WHEN P.ReferredBy IS NULL THEN Pt.Create_Dtime END) As DLs_ReferredBy_Null,
    Count(CASE WHEN P.ReferredBy IS NOT NULL THEN Pt.Create_Dtime END) As DLs_ReferredBy_NotNull
    From Player_Aux_Pt Pt
    Inner Join Player P On Pt.Player_Id=P.Player_Id
    Where
    Pt.Site = 'AppCircle'
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query below: SELECT a.id, b.item_name FROM table_1 as a INNER JOIN
I have a below query: select count(*) c , id from hr where time
I have the below query in a postgresql database SELECT * FROM accounts where
I have the below query: SELECT p.id as prod_id, * FROM products AS p
I have tried the below query: select empno from ( select empno from emp
I have the below SQL query: SELECT g.name AS gname, COUNT(u.id) AS noMembers, f.name
I have below SQL query: SELECT * FROM ( SELECT S.aCol, S.bCol, S.cCol, ROW_NUMBER()
I have this query below: $msgg = mysql_query(SELECT * FROM mytable WHERE time>$time AND
Heya!, I have the below query: SELECT t1.pm_id FROM fb_user_pms AS t1, fb_user_pm_replies AS
I have below query Select RPAD(x.QUOTE_ID,20,' ') from csa_sli_all.T_CONV_XREF_CUST_QUOTE x , csa_sli_all.T_CONV_quote q where

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.