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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:06:32+00:00 2026-05-28T01:06:32+00:00

p1.username always has a value that’s foreign to VB_user table. The problem is that

  • 0

p1.username always has a value that’s foreign to VB_user table. The problem is that p2.username has a default value of 0 and it’s not a value in the VB_user table. So if I run the query it will only show the results if p2.username doesn’t have a value of zero. How can I make it so if p2.username has the value of 0 it will show in my results, since VB_user.userid doesn’t have a 0 can it, can I still show something?

In other words, I want to be able to show the results of p2.username even if its value is 0.

Here’s my query:

SELECT p.r1, p.r2, p.rounds, p.whenmatch, p.created, p.status, p.lid, p1.userid AS userid1, p1.username AS challenger, p2.userid AS userid2, p2.username AS challenged, p3.lname 
        FROM AB_league_match p 
        JOIN VB_user p1 on p.challenger = p1.userid 
        JOIN VB_user p2 on p.challenged = p2.userid 
        JOIN AB_league p3 on p.lid = p3.id
  • 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-28T01:06:33+00:00Added an answer on May 28, 2026 at 1:06 am
    SELECT p.r1, p.r2, p.rounds, p.whenmatch, p.created, p.status, p.lid, p1.userid AS userid1, p1.username AS challenger, p2.userid AS userid2, p2.username AS challenged, p3.lname 
            FROM AB_league_match p 
            JOIN VB_user p1 on p.challenger = p1.userid 
            LEFT JOIN VB_user p2 on p.challenged = p2.userid 
            JOIN AB_league p3 on p.lid = p3.id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering if the aspnet_Users table is always sorted (by UserName) even if
I have been having a problem that has troubled me for a while. Searching
I have a WCF service that has a method to return the Windows Username
It seems that this problem has already been encountered by quite a few people:
vs2008 (and earlier versions) always creates empty folders in c:\users\<username>\my documents every time it
string format is always like this FirstName=ABC;LastName=XZY;Username=User1;Password=1234. I need the only UserName value (which
I have a couple of design/architectural questions that always come up in our shop.
I have created a custom validation rule (uniqueUserName). The problem I'm having is that
I had a weird problem, our website has registration form coded using zend form,
The scenario - legacy application with 10 year history, has always used procedure calls

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.