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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:18:52+00:00 2026-06-14T14:18:52+00:00

I have this query with an sub query as clicks I want to do

  • 0

I have this query with an sub query as clicks
I want to do then where clicks > 0, but I get an error that this is not an recognized column.

SELECT top 10 *, (select count(*) FROM po_events aeclk WITH(NOLOCK) where (aeclk.[source] = ae.[source]) as clicks

FROM archived_events ae with(NOLOCK) 
where clicks > 0
  • 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-14T14:18:53+00:00Added an answer on June 14, 2026 at 2:18 pm

    While I agree with the comment that this is a possible duplicate, I’d also like to point out that correlated subqueries can be inefficient; killing two birds with one stone, you could do something like:

    SELECT TOP 10
            ae.*
          , aeclk.clicks
    FROM    archived_events ae
            JOIN ( SELECT   source
                          , COUNT(*) AS clicks
                   FROM     po_events
                   GROUP BY source
                 ) aeclk ON aeclk.[source] = ae.[source]
    WHERE   clicks > 0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query that works as desired, but it seems like there should
I am trying to have information displayed for this query: SELECT o.sub_number,o.unique_id,o.period_from,o.period_to,o.total_amt, i.paid_amt,i.dated,i.payment,i.paid_by,i.entered_date,i.paid_for_unique, j.cheque_num,j.drawn_on,j.dated
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
I have this query... SELECT Distinct([TargetAttributeID]) FROM (SELECT distinct att1.intAttributeID as [TargetAttributeID] FROM AST_tblAttributes
i have this query: SELECT `completed`.`ID` AS `ID`,`completed`.`level` AS `level`,`completed`.`completed_in` AS `completed_in`, COUNT(1) AS
I have this query SELECT zip, ( 3959 * acos( cos( radians(34.12520) ) *
I have this query that returns the results by ordering it by focus.name ASC.
I have this query: SELECT p.text,se.name,s.sub_name,SUM((p.volume / (SELECT SUM(p.volume) FROM phrase p WHERE p.volume
I have this query: $events = db_query(SELECT e.name, e.event_date, e.time, e.data, e.picture, e.event_type, v.latitude,
I have an error in my query sub query. I been trying to work

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.