如何在同一个Talbe中建立一对多的关系 [英] How To Make Relationship one To many In The Same Talbe

查看:64
本文介绍了如何在同一个Talbe中建立一对多的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我使用SQL和ASp.Net我的问题是我有物品表

Item_ID BigInt

item_name nv

Parent_id BigInt

is_product位

is_material位

for_sale位

该项目可能是产品或材料

i需要将项目与其材料相关联请注意,这可能是一种材料与多个产品相关

Hi I Am Using SQL And ASp.Net my problem is that i have Items Table
Item_ID BigInt
item_name nv
Parent_id BigInt
is_product Bit
is_material Bit
for_sale Bit
the item May Be a Product Or material
i Need To relate the item With Its material "Note that may be one material is Related To more Than One Product"

推荐答案

检查这个



http:// stackoverflow。 com / questions / 4116416 / parent-child-in-same-table [ ^ ]

http://stackoverflow.com/questions/2763860/how-to-query-with-child-关系到同一表和订单 - 这是正确的 [ ^ ]
check this

http://stackoverflow.com/questions/4116416/parent-child-in-same-table[^]
http://stackoverflow.com/questions/2763860/how-to-query-with-child-relations-to-same-table-and-order-this-correctly[^]


这篇关于如何在同一个Talbe中建立一对多的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆