如何将表格分为2个表格 [英] How I Can divide Table into 2 Table

查看:85
本文介绍了如何将表格分为2个表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从数据库中获取数据.

我需要根据int值1或0将其分为2个表.
这意味着所有1个字段值都排在第一个表中,所有0个字段值都排在第2个表中[asp.net]

有人有什么想法吗?
请与我分享

[edit]将"divided"更改为"divide" [/edit]

I get Data from a database.

I need to divide it into 2 tables according to int value 1 or 0.
That means all 1 field value comes 1st table and all 0 field value comes 2nd table [asp.net]

Anyone have any ideas?
Please share them with me

[edit] changed ''divided'' to ''divide'' [/edit]

推荐答案

编写存储过程,其中写入两个选择查询
除where条件
外,查询应相同
从表中选择*,其中fieldvalue = 1

从表中选择*,其中fieldvalue = 0

使用dataadapter.fill方法填充数据集.

它将为您提供两个表,两个查询都返回数据


希望对您有帮助
write stored procedure in which write two select queries
queries should be same except the where condition

select * from table where fieldvalue =1

select * from table where fieldvalue =0

use dataadapter.fill method to fill the dataset.

It will give you two tables with both queries returning data


hope this helps


您可以尝试在表的视图过滤器值中创建两个视图.
you can try to create two view in view filter value from table.


这篇关于如何将表格分为2个表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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