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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:52:14+00:00 2026-06-01T13:52:14+00:00

Im doing a search where the POST is: sok3 = 0,2,6 I would then

  • 0

Im doing a search where the POST is: sok3 = 0,2,6

I would then like to select all users that matches this POST(sok3) from table2, where columns could be like this:

table1:

id|name
1 |myname

table2:

id|uid|sok3
0 |1  |0
1 |1  |2
2 |1  |4
3 |1  |6
4 |6  |1
5 |6  |2
6 |6  |4

I have tried with:

SELECT * from table1 as tab1 LEFT JOIN table2 as tab2 ON(tab2.uid = tab1.id) Where .. 

The result i get is 3 matches. BUT i only want 1 result, where there is a match.
if 0 then its a match, if 0,2 there is match etc..

I know i dont even search for the Post.. just dont know how to solve it :/

How can i solve this one? 🙂

  • 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-01T13:52:16+00:00Added an answer on June 1, 2026 at 1:52 pm

    Either use SELECT DISTINCT name or GROUP BY name in your query

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

Sidebar

Related Questions

Hi I have a post model that :has_many :reply, when using searchlogic, doing Post.reply_content_like(search),
I would like to include a feature that lets users of my site sort
SELECT p.id, p.title, p.uri, 'post' AS search_type FROM `posts` AS p WHERE title LIKE
I am doing a ALPHABETICAL ORDER SEARCH module for a project. that is it
I'm doing a lookup from LDAP where I need to search based on a
All, Considering my earlier query Stackoverflow-Post , here is what I am currently doing.
I'm trying to do something like the following: $.ajax({ url: /Track/Search, type: POST, data:
I'm using Django Forms to do a filtered/faceted search via POST, and I would
Referring to this post and this one . I'm trying to implement tag search
I'm doing a vehicle search on our site, you select the make and ajax

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.