Jump to content

Problems Selecting With A Left Join


Shadowing

Recommended Posts

Hey guys im trying to select a row from table planets where there are no matches between

planet.address and travel.defender_planet

 

I dont think im using inner join correctly at all here

i'm thinking when you want a return result it wont work when there are not two columns matching in two tables

 

 

SELECT planets.address FROM planets LEFT JOIN travel ON planets.address != travel.defender_planet WHERE planets.address != travel.defender_planet LIMIT 1

 

 

My end objective is to let me select a row from planets.address where there are no rows in travel table with that address

Link to comment
Share on other sites

what i really wanted to do was use a left join in a update. so im updating the row in the same query and also comparing to make sure the row im selecting isnt matching in the travel table.

 

something like this but syntax is incorrect

 

UPDATE planets SET planets.id = 4005 LEFT JOIN travel ON planets.address = travel.defender_planet WHERE travel.defender_planet IS NULL

Link to comment
Share on other sites

places the players id on the planet to show he owns it

 

This script doesnt get used much maybe i should just do this with two seperate queries

 

Thought it would be kewl if it was combinable.

 

I just started with using joins on my scripts so pretty new to it.

Edited by Shadowing
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.