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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:07:17+00:00 2026-05-17T15:07:17+00:00

Following on from MySQL multiple Id lookups So I’m looking at other ways around

  • 0

Following on from MySQL multiple Id lookups

So I’m looking at other ways around the fulltextsearch limitation on views.

I updated the provided query…

SELECT  t.teacherId, s1.subjectName AS name1, s2.subjectName AS name2, s3.subjectName AS name3
FROM    teacherProfile t
LEFT JOIN
        subjects s1
ON      s1.subjectId = t.subjectOne 
LEFT JOIN
        subjects s2
ON      s2.subjectId = t.subjectTwo
LEFT JOIN
        subjects s3
ON      s3.subjectId = t.subjectThree

Which works a treat at least, but if I add..

WHERE name1 = ENGLISH'

to the end I get Unknown column name1, can I not even do a simple query on the data?

  • 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-17T15:07:17+00:00Added an answer on May 17, 2026 at 3:07 pm
    SELECT  t.teacherId, s1.subjectName AS name1, s2.subjectName AS name2, s3.subjectName AS name3
    FROM    teacherProfile t
    LEFT JOIN
            subjects s1
    ON      s1.subjectId = t.subjectOne 
    LEFT JOIN
            subjects s2
    ON      s2.subjectId = t.subjectTwo
    LEFT JOIN
            subjects s3
    ON      s3.subjectId = t.subjectThree
    WHERE   'English' IN (s1.subjectName, s2.subjectName, s3.subjectName)
    

    , or, referring to your original problem,

    SELECT  t.teacherId, s1.subjectName AS name1, s2.subjectName AS name2, s3.subjectName AS name3
    FROM    teacherProfile t
    LEFT JOIN
            subjects s1
    ON      s1.subjectId = t.subjectOne 
    LEFT JOIN
            subjects s2
    ON      s2.subjectId = t.subjectTwo
    LEFT JOIN
            subjects s3
    ON      s3.subjectId = t.subjectThree
    WHERE   MATCH(s1.subjectName, s2.subjectName, s3.subjectName) AGAINST ('+English +Physics' IN BOOLEAN MODE)
    

    (works only if both tables are MyISAM)

    This will return all teachers who teach both English and Physics.

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

Sidebar

Related Questions

When selecting from multiple tables in MySQL, both of the following queries return the
following is the that I create dump from mysql database. mysqldump -u root tempbkk
I get the following error when inserting data from mysql into postgres. Do I
I have the following task: there are a simple table from mysql database: <html>
I'm using following code but cannot return data from MySQL. This is the output:
I have the following query to select users and their locations, etc from MySQL
From the mysql certification guide's example questions ... question Will the following SQL statement
In reading High performance MySQL from O'Reilly I've stumbled upon the following Another common
I have the following table: I want to insert values from the MySQL workbench.
I have the following php code that gets a serialized array from a mysql

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.