Search result for two unrelated tables

Asked

Viewed 128 times

0

I have a doubt if it is possible to return in a query, records of two different tables, and these tables have no relation.

I have the clothes table and accessories table. I will make a dynamic filter to list clothes (color, size and price) and accessories (categories). Initially I imagined modeling a table products, clothes and accessories, and the last two are daughters of the first(But I do not want the products table).

  • If there is no relationship can not relate... why has the table accessories only with categories? If you simply want to relate clothes to categories, add a category field in the clothes table. (from the beginning of a 1.*-1 relationship)

  • I just want the query to return mixed data in the filter, both clothing and accessories. Accessories are not clothes so I imagine not relate.

  • Disagreeing with @Fabiocardoso has no reason to add the category field in the clothes table, at most it would add an id column to "connect" both. What the author probably meant by relating is to query two unrelated tables using a single query. It is possible to relate both, tell me one thing, accessories are specific by products or it can go in various products?

  • Guilherme, accessories have N categories (Bag, necklaces, earrings etc..) already the clothes will not have categories, will have (Size, color and price). My query initially returns all the items in the clothes table and all the accessories. But when clicked on a category of accessories the query should list all clothes and only the accessories of the selected category

  • Any suggestions?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.