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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:50:41+00:00 2026-05-29T09:50:41+00:00

I want to only return a row if either of the subquery returns a

  • 0

I want to only return a row if either of the subquery returns a field.

SELECT upd8r_user_accts.id, (

SELECT fb_id
FROM upd8r_facebook_accts
WHERE user_id = upd8r_user_accts.id
) as facebook, (

SELECT twitter
FROM upd8r_twitter_accts
WHERE user_id = upd8r_user_accts.id
) as twitter
FROM  `upd8r_user_accts` 

also i am returning id/access token values for each of the subqueries- how could i return a boolean value of yes or no?

  • 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-29T09:50:42+00:00Added an answer on May 29, 2026 at 9:50 am
    SELECT
      upd8r_user_accts.id,
      upd8r_facebook_accts.fb_id  IS NOT NULL  AS has_fb_id,
      upd8r_twitter_accts.twitter IS NOT NULL  AS has_twitter
    FROM
      upd8r_user_accts
    LEFT JOIN
      upd8r_twitter_accts
        ON upd8r_twitter_accts.user_id = upd8r_user_accts.id
    LEFT JOIN
      upd8r_facebook_accts
        ON upd8r_facebook_accts.user_id = upd8r_user_accts.id
    WHERE
         upd8r_facebook_accts.fb_id  IS NOT NULL
      OR upd8r_twitter_accts.twitter IS NOT NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL query which I only ever want to return 1 row.
I want to implement all my own rotation animations but if I only return
I want to run a basic query, but return only the first ten rows
How can I return the key?, mean if I want to allow only integer
I want regExp to test for two 'Hello'-s and return true but it only
document.onkeydown.toString() returns onkeydown function but I only want to get this function's name. Is
I used HTTPService for reading xml, but I want only a particular xml field
I'm making a newsfeed type of thing and I want to select from multiple
Is it possible in php to return a specific row of data from a
I want to remove a row from an HTML table generated by some Rails

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.