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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:10:20+00:00 2026-06-04T07:10:20+00:00

here is my query that makes an error for Join $query = ‘SELECT a.ks_u_id,

  • 0

here is my query that makes an error for Join

        $query = 'SELECT 
                    a.ks_u_id, 
                    a.ks_keyword,
                    b.u_photo 
                FROM 
                '.T_KEYWORD_HISTORY.' a 
                WHERE a.ks_u_id in ( SELECT uf_target_id FROM '.T_USER_FOLLOW.' WHERE uf_user_id="'.$u_id.'" and uf_target_id <> "'.$u_id.'" )
                JOIN '.T_USER_ACCOUNT.' b ON b.u_id = a.ks_u_id 
                ORDER BY a.ks_time DESC 
                LIMIT 0 , 5 ';

I get this error message.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'JOIN T_USER_ACCOUNT b ON b.u_id = a.ks_u_id ORDER BY a.ks_time DESC ' at line 8

SELECT 
     a.ks_u_id, a.ks_keyword, b.u_photo 
FROM T_KEYWORD_HISTORY a 
WHERE a.ks_u_id in ( SELECT uf_target_id 
                     FROM T_USER_FOLLOW 
                     WHERE uf_user_id="jake" and uf_target_id <> "jake" ) 
JOIN T_USER_ACCOUNT b ON b.u_id = a.ks_u_id 
ORDER BY a.ks_time DESC 
LIMIT 0 , 5

It looks like I wrote wrong query for JOIN command.

  • 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-04T07:10:21+00:00Added an answer on June 4, 2026 at 7:10 am

    Try

    SELECT 
         a.ks_u_id, a.ks_keyword, b.u_photo 
    FROM T_KEYWORD_HISTORY a 
    JOIN T_USER_ACCOUNT b ON b.u_id = a.ks_u_id 
    WHERE a.ks_u_id in ( SELECT uf_target_id 
                         FROM T_USER_FOLLOW 
                         WHERE uf_user_id="jake" and uf_target_id <> "jake" ) 
    ORDER BY a.ks_time DESC 
    LIMIT 0 , 5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the query that I am working on: SELECT `unitid`, `name` FROM apartmentunits
Here is my query Select Gender from Table The result pane shows 1 1
Here is my Query : select EmployeeName, EmployeeSalary from Employee2 for xml path('EmployeeDetails') returns
I've got query SELECT frst.Date,t1.Value from [ArchiveAnalog] frst LEFT JOIN (SELECT Date,Value FROM [ArchiveAnalog]
Ok, here's a query that I am running right now on a table that
Here is the snapshot of the query that doesn't work since I added the
Here is a silly question. Lets say I have a query that produces for
Here's the query: SELECT COUNT(*) AS c, MAX(`followers_count`) AS max_fc, MIN(`followers_count`) AS min_fc, MAX(`following_count`)
I've got a query that calls a function in its select clause. The function
The following MySQL query: select `userID` as uID, (select `siteID` from `users` where `userID`

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.