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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:08:43+00:00 2026-05-31T01:08:43+00:00

I am trying to choose the row where 1) list.ispublic = 1 2) userlist.userid=’aaa’

  • 0

I am trying to choose the row where

1)list.ispublic = 1
2)userlist.userid='aaa' AND userlist.listid=list.listid

I need 1)+2)

There is a row already but this statement can not get that row, is there any problem?

List table:

ListID  ListName    Creator IsRemindSub IsRemindUnSub   IsPublic    CreateDate  LastModified    Reminder
1       test2       aaa     0           0               1           2012-03-09  NULL            NULL

user_list table (No row):

UserID ListID UserRights

My test version

SELECT * 
FROM list l 
INNER JOIN user_list ul ON ul.ListID = l.ListID 
WHERE l.IsPublic = 1 AND ul.UserID = '09185346d'

This is the Result when there are two list in user_list has aaa , and one list is public in list, so will this cause double retrieve of that one public list in list if i get it in php ?

ListID    ListName    Creator    IsRemindSub    IsRemindUnSub    IsPublic    CreateDate    LastModified    Reminder    UserID    ListID    UserRights
1         test2       aaa        0              0                1           2012-03-09    NULL                        aaa       1         read
2         t2          aaa        0              0                1           2012-03-09    NULL                        aaa       2         read
  • 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-31T01:08:45+00:00Added an answer on May 31, 2026 at 1:08 am

    First, try to only SELECT the fields you actually need. Second, write your JOINS explicitly – it helps readability. For example:

    SELECT l.*, ul.*
    FROM list l
    INNER JOIN user_list ul ON ul.ListID = l.ListID
    WHERE l.IsPublic = 1
      AND ul.UserID = 'aaa'
    

    Incidentally, if you have no data in your user_list table, then you have no way to meet the requirements you have set. If as you put it “userlist.listid=list.listid” is necessary and the user_list table is empty, you will always get zero rows returned.

    Edit: And no, it won’t cause rows to be retrieved double. Whatever results you get with your SQL query will be the same results you get in a PHP script – the mechanism for retrieving the data is the same.

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

Sidebar

Related Questions

So I have this code: <xsl:for-each select=item> <Row> <Cell Borders=#ffffff> <xsl:attribute name=Background> <xsl:choose> <xsl:when
I am trying to choose the single row from table Responses that meets a
I'm trying to choose some files to upload in Windows Phone 7 (in the
I'm trying to choose a certificate from the computer certificate store LocalMachine\My that serves
Having problems with a small awk script, Im trying to choose the newest of
I'm trying to decide how to choose between the WSO2 Gadget Server and WSO2
I am trying to set up Emacs so that when I choose Compile.. in
(source: yfrog.com ) I am trying my hand at making an invaders clone. there
I am trying to delete a row using the DataTables plugin. First I don't
I'm trying to develop a JS function that creates a new row each time

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.