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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:15:11+00:00 2026-05-30T07:15:11+00:00

Table 1 -> id, name Table 2 -> id, name, text_value, table1_id, table3_id Table

  • 0

Table 1 -> id, name
Table 2 -> id, name, text_value, table1_id, table3_id
Table 3 -> id, name

SELECT * FROM `table1`   
LEFT OUTER JOIN table2 ON table1.id = table2.table1_id   
WHERE 
 (
     (table2.table3_id = '7' AND table2.name like ('%test%'))
 )   
  AND 
 (
      table2.table3_id = '1' and table2.text_value like ('%fast update%'))
 )   
GROUP BY table1.id  
ORDER BY table1.id desc
  • 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-30T07:15:12+00:00Added an answer on May 30, 2026 at 7:15 am

    Yes, but you need two joins to do so:

    • Because you will be joining to table2 twice, one of the joins must
      use an alias. I chose t2.
    • Change the AND to LEFT OUTER JOIN table2 AS t2 ON.
    • In the remainder of the query, change table2 to t2.
    • When you use GROUP BY, all the columns that you specify need to be in either the GROUP BY clause or an aggregate. Since you didn’t do that, and it is unclear why you tried to use GROUP BY, I am eliminating the GROUP BY clause.

    There are several other changes. See final query below:

    SELECT
      table1.id
    FROM
      table1
        LEFT OUTER JOIN
      table2
        ON table1.id = table2.table1_id
        LEFT OUTER JOIN
      table2 t2
        ON table1.id = t2.table1_id
    WHERE
      table2.table3_id = '7'
        and
      table2.name like '%test%'
        AND
      t2.table3_id = '1'
        and
      t2.text_value like '%fast update%'
    ORDER BY
      table1.id DESC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

@Entity @Table(name = BOOKTEST) @NamedQueries({@NamedQuery(name = Booktest.findAll, query = SELECT b FROM Booktest b),
I have a table where a record looks like this varchar(255) Name varchar(255) Text
I have a table in SQL Server which looks like this: ID Code Name
I have this query: SELECT p.text,se.name,s.sub_name,SUM((p.volume / (SELECT SUM(p.volume) FROM phrase p WHERE p.volume
I have user table having fields gender and first name like this.. The value
SELECT * FROM locations JOIN section_has_location ON locations.location_id = section_has_location.location_id WHERE section_has_location.chapter_id =2 AND
Here is my table: id int(11) name varchar(255) description text highest_bidder int(11) value varchar(255)
Imagine the following tables: create table boxes( id int, name text, ...); create table
How can i export table data with column name in text file in sql
based on the following table Name --------- A A A B B C C

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.