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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:44:12+00:00 2026-05-25T03:44:12+00:00

I tried looking for a question such as this on SO but a lot

  • 0

I tried looking for a question such as this on SO but a lot of them were outer joins with more complicated select clauses whereas my question is more simple and should be a faster reference for newbies at MySQL.

Being used to Oracle SQL, I was trying to join three tables and perform a delete like so:

DELETE * FROM tbl_login, tbl_profile, images
WHERE tbl_login.loginid = tbl_profile.loginid
AND tbl_profile.loginid = images.loginid
AND loginid = 'derek';

In MySQL my attempt is:

DELETE FROM tbl_profile, images, tbl_login
USING tbl_profile INNER JOIN images INNER JOIN tbl_login
WHERE tbl_profile.loginid = images.loginid 
AND images.loginid = tbl_login.loginid
AND loginid='derek';

I ran this in the SQL section of PHPMyadmin and it told me that loginid was ambiguous which I thought was funny because if I’m joining the three tables why would it be ambiguous? So I edited it and made it

tbl_login.loginid = 'derek' 

that deleted the correct row from the tbl_login table but it ended up deleting all the rows from my other tables. What am I doing wrong here?

  • 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-25T03:44:13+00:00Added an answer on May 25, 2026 at 3:44 am

    I think your query should look something like this (note the different way the join conditions are defined):

    DELETE FROM tbl_profile, images, tbl_login
    USING tbl_profile INNER JOIN images ON images.loginid = tbl_profile.loginid
    INNER JOIN tbl_login ON tbl_login.loginid = tbl_profile.loginid
    WHERE tbl_login.loginid='derek';
    

    I assume you want to delete the rows from all 3 tables. If you only want to delete from tbl_login, the previous answer tells you how to do it 🙂

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

Sidebar

Related Questions

I know silly question but i tried looking it up on Google with no
I've tried looking around and there are similar problems, but mine is way more
I had tried looking up on here many different answers to this question and
This question has been asked more than once before, but I have not found
I've tried looking at similar problems, but could not easily find one that helped
i have tried looking online but had no luck, How i could delete all
What exactly does execve() do? I've tried looking at the documentation (http://linux.die.net/man/2/execve) but given
I tried urllib{2}, pycurl and I'm looking at twisted's new http client. But: I
I know a lot of question regarding VB6 migration have been asked, but I
This might seem like a silly question, but after asking some questions on stackoverflow

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.