且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用相同的主键值以及如何在同一个外键表中调用两次?

更新时间:2022-12-09 16:46:41

使用类似于此的一些SQL来返回类似的item:



 选择 * 来自 tbl_similar_pdt 其中​​((sid = VALUE)(sim_pdt_id = VALUE)) 


<pre lang="text">I have two table and how to create the relationship in c# 
1)TBL_PDT(product),pdt_id (primary key),pdt_name,pdt_description;
2)TBL_SIMILAR_PDT(similar product),sid(foreign key of TBL_PDT),sim L_PDT),sim_pdt_id(foreign key of TBL_PDT),sim_pdt_desc;

1)how to call the same product id from same foreign key table (TBL_SIMILAR_PDT)?

2)how to values are dropdownlist1(pdt_id) and dropdownlist2(pdt_id)?




PLEASE HELP ME!!!

Use a bit of SQL similar to this to return similar items:

select * from tbl_similar_pdt where ((sid = VALUE) or (sim_pdt_id = VALUE))