Jump to content

Need help forming a SELECT query


xcasio

Recommended Posts

Hi,

 

I need some help on a SELECT query. This is my table structure with only relevant fields:

 

Table #1: interiors

id (int)

MapIconID (int)

 

Table #2: properties

id (int)

IntID (int)

 

What I want to accomplish is selecting all of the rows in properties, getting the MapIconID from the interiors table by using the IntID field.

 

I'm not really good at explaining and it might sound confusing, so here's how it should work:

* Select all the fields from properties

* Find the `IntID` of each field and match it up with the corresponding id in the `interiors` table

* Make a new column called `MapIconID` and display it

 

Okay, I still think this sounds confusing - one more example.

 

Example of `interiors`:

Row 1: id:20, MapIconID:506

Row 2: id:21, MapIconID:149

 

Example of `properties`:

Row 1: id:55, IntID:20

Row 2: id:56, IntID:0

 

What the result should be after selecting `properties`

Row 1: id:55, IntID:20, MapIconID:506

Row 2: id:56, IntID:0, MapIconID:0

 

Hopefully someone can help me!

 

Thank you kindly for your help.

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.