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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:48:01+00:00 2026-06-03T16:48:01+00:00

Hi I need help adding a new CLAUSE, this one is pretty advanced for

  • 0

Hi I need help adding a new CLAUSE, this one is pretty advanced for me and I can’t figure it out. //using the ect.author_id query the exp_channel_titles table author_id column and scan those rows for the final result. To be determined by IF ect.status = ‘Members-id5’ AND ect.status = ‘complete’… then use the row with Members-id5 for ect.entry_id. My question is how would I do that? I marked where I assume the new CLAUSE or maybe even query would go, but I could be wrong.

My problem is there is up to 5 different ect.entry_id so i’m trying to isolate the one in the row with status = Members_id5 but only if status = complete exist as well. This seems like something I would have to do in PHP with array’s any thoughts?

    SELECT
             ect.entry_id
        ,    ect.author_id
        ,    ect.title
        ,    ect.status
        ,    ecd.field_id_13
        ,    ecd.field_id_14
        ,    ecd.field_id_15
        ,    ecd.field_id_25
        ,    ecd.field_id_27
        ,    ecd.field_id_28
        ,    ecd.field_id_29
        ,    ecd.field_id_30
        ,    ecd.field_id_31
        ,    ecd.field_id_32
        ,    ecd.field_id_33
        ,    ecd.field_id_34
        ,    ecd.field_id_35
        ,    exm.email
    FROM exp_channel_titles as ect
    LEFT JOIN exp_channel_data as ecd
      ON ecd.entry_id = ect.entry_id
    LEFT JOIN exp_members as exm
      ON exm.member_id = ect.author_id

// new CLAUSE

    WHERE ect.title LIKE '%Member%'
    AND ect.status = 'Members-id5'
  • 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-03T16:48:07+00:00Added an answer on June 3, 2026 at 4:48 pm

    Based on your comment, it sounds like you want to find individuals who have one record where ect.status = “Members-id5” and another where ect.status = “complete” . You then want the SELECT query to apply just to those individuals. You can do that using two subqueries within the WHERE clause. Something like this:

    WHERE ect.title LIKE '%Member%'
    AND ect.author_id IN 
         (select author_id from exp_channel_titles where ect.status = "Members-id5")
    AND ect.author_id IN
         (select author_id from exp_channel_titles where ect.status = "complete")
    

    The first subquery generates a list of all author IDs that have at least one record with “Members-id5” in it, and the IN clause checks to see if the author ID currently under consideration is one of those. The second one does the same with a list of all author IDs that have a record with “complete”. If both conditions are true, then that means that individual is one whose records you want to return.

    I’m not familiar with your data structure so this may not be the exact code you need (in particular, ect.author_id may not actually be the field to compare on), but hopefully this gives you the idea.

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

Sidebar

Related Questions

I need some help adding conditions to a linq query. Take this small example
Need help writing a script downloads data from google insight using c# this is
I'm new to iPhone dev and need some help with adding subViews. I have
Kind of stuck with this thing, that's why need help please. I am using
I need a little help clearing something up with Zend_Form and adding filters to
I need help finishing this statement. It is frustrating that two of the PHP
I am very new to regular expressions, and I need some help. First I
I am reading this tutorial : http://sleekd.com/general/adding-multiple-images-to-a-rails-model-with-paperclip/ because i need Save the product images
I need some help getting my head around thread safety and dictionaries. When adding
i need some help regarding adding values into an array for example long[] s

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.