Jump to content

Mysql Query


kigogu

Recommended Posts

I have a query like,

 

SELECT * FROM account_duplicate WHERE id = account.id AND account.found = 0 AND account.name LIKE %something%

 

What I want to do is select all the entries from the account_duplicate table where the id equals the id from the account table, the found value from the account table is equal to 0 and the name of the account is similar to "some name"

 

I am new to mysql so I am not sure how I might be able to do this lol I know it is probably something simple but any help would be appreciated ^^

Link to comment
Share on other sites

Alright! I have found the answer, after searching forever. I just ended up doing a LEFT JOIN so my query ended up being:

SELECT * FROM account_duplicate LEFT JOIN account ON account_duplicate.id = account.id WHERE account.found = 0 AND account.name LIKE '%something%'

is this an alright result to go? no one really has to answer this, its only for more understanding, but as far as my original question is concerned it has been answered

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.