如何在表的列中保存网格的某些选定行 [英] how to save the some selected row of a grid in column of a table

查看:53
本文介绍了如何在表的列中保存网格的某些选定行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Gridview有8列,如material,contractrate,wtFactor,JanPrice,FebPrice,MarPrice,AVGPrice



保存到数据库中,如

材料 签订合同 wtFactor 价格

M1 R1 W1 Jan1Price

M1 R1 W1 Feb1价格

M1 R1 W1 Mar1Price

M1 R1 W1 AVG1Price

M2 R2 W2 Jan2Price

M2 R2 W2 Feb2Price

M2 R2 W2 Mar2Price

M2 R2 W2 AVG2Price

这里Gridview列数据如JanPrice,FebPrice,MarPrice,AVGPrice将是保存一个

A Gridview has 8 columns like material,contractrate,wtFactor,JanPrice,FebPrice,MarPrice,AVGPrice

Save into database like
material contractrate wtFactor Price
M1 R1 W1 Jan1Price
M1 R1 W1 Feb1Price
M1 R1 W1 Mar1Price
M1 R1 W1 AVG1Price
M2 R2 W2 Jan2Price
M2 R2 W2 Feb2Price
M2 R2 W2 Mar2Price
M2 R2 W2 AVG2Price
Here Gridview Column data like JanPrice,FebPrice,MarPrice,AVGPrice will be save one

推荐答案

Y.你可以使用枢轴。



以下参考可以帮助你。



在SQL查询中使用Pivot的简单方法 [ ^ ]
You can use the pivot.

Below reference may help you.

Simple Way To Use Pivot In SQL Query[^]


这篇关于如何在表的列中保存网格的某些选定行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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