Jump to content

Recommended Posts

Umm, what do you mean by table setup?

I think the point of the question is to determine whether a subcategory is associated with a specific category, because you may be able to execute a single SQL query to retrieve data from both tables in one go

Umm, what do you mean by table setup?

I think the point of the question is to determine whether a subcategory is associated with a specific category, because you may be able to execute a single SQL query to retrieve data from both tables in one go

 

Yeah thats what i was getting at...

Umm, ok it is not associated.

category - id name

subcategory- id name category_id

suggests that it is associated, on category_id.

 

Alternatively, you could use a UNION in your query:

SELECT ID,
       NAME
  FROM CATEGORY
UNION
SELECT ID,
       NAME
  FROM SUBCATEGORY

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.