如何解决以下数据库问题....... [英] How to solve below database problem.......

查看:80
本文介绍了如何解决以下数据库问题.......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里有5列,,,这是输出,实际上我不需要..只有产品名称,代码和价格只能获得一次....







产品名称产品代码价格技术规格价值

英特尔Corei3 ---- 3220 --- - 3000 - - SocketType --- --- LGA 1155

英特尔酷睿i3 ---- 3220 --- - 3000 ---架构--- --- 64位

intel Core i3 ---- 3220 --- - 3000 --- Turbo Boost --- ---是

intel Core i3 ---- 3220 --- - - 3000 ---型号ID --- --- Core I3



以下需要



产品名称产品代码价格技术规格价值

英特尔Corei3 ---- 3220 --- - 3000 ---- SocketType --- --- LGA 1155

---------------- ---- --- - ----- --- - 建筑--- --- 64位

---------------- ---- --- - --- - --- Turbo Boost --- ---是

---------------- ---- --- - --- - ----型号ID --- ---核心I3

here there are 5 columns ,,,this is output that actually i dont required..only product name ,code and price ony get at only one time....



Product Name Product Code Price Technical Specification Value
intel Corei3 ---- 3220 --- -- 3000 --- SocketType --- --- LGA 1155
intel Core i3---- 3220 --- -- 3000 --- Architecture --- --- 64-bit
intel Core i3---- 3220 --- -- 3000 --- Turbo Boost --- --- yes
intel Core i3---- 3220 --- -- 3000 --- Model ID --- --- Core I3

below that is required

Product Name Product Code Price Technical Specification Value
intel Corei3 ---- 3220 --- -- 3000 ---- SocketType --- --- LGA 1155
---------------- ---- --- -- ----- ----- Architecture --- --- 64-bit
---------------- ---- --- -- --- ----- Turbo Boost --- --- yes
---------------- ---- --- -- --- ------ Model ID --- --- Core I3

推荐答案

设计不良。我明白你想要什么,但这不是这样做的方法。

1)以1:N关系将资产和属性分成两个表格

2 )选择资产,而不是它的属性,并在演示方面解决这个演示问题。

3)但即使保留这个数据库模型,你也要把它当作一个主要的细节来考虑关系:资产是主要的,属性是细节。不要在数据访问层上推送演示任务!
Bad design. I understand what you want, but this is not the way to do it.
1) Separate the asset and the properties in two tables in an 1:N relation
2) Select the asset, than it''s properties and solve this "presentation issue" on presentation side.
3) But even keeping this database model, you have to think about it as a master-detail relation: the asset is the master, the properties are details. Don''t push the presentation task on the data access layer!


这篇关于如何解决以下数据库问题.......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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