建议我更多行或更多列将是最好的。 [英] Suggest me more row or more column will be best.

查看:63
本文介绍了建议我更多行或更多列将是最好的。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为tbl_monthly_budget_expenses的表,其中我在列下面。我使用这张表进行月度扩展。是没关系,否则我应该使用扩展列和单独的日期列。我这里有大量数据



Id | MasterId |代码|名称|部门| Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | 11月| 12月|日期|年

I have an table named tbl_monthly_budget_expenses where i have below column . Im using this table for monthly expanses. Is that ok or else i should go with expanses column and a seprate date column. I have huge data here

Id|MasterId|Code|Name|Dept|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec|Date|year

推荐答案

不,你需要坐下来重新考虑整个数据库设计。

你是字符串每个条目的名称和部门?为什么?



我会:

a Depts table

a用户表引用Depts表

一个费用表,引用用户表并保存一个费用明细(日期,金额,收据信息等)



然后使用联接,组等来组织它以进行检索。
No, you need to sit down and rethink the whole DB design.
You are string the name and department with every entry? Why?

I would have:
a Depts table
a Users table that refers to the Depts table
an Expenses table that refers to the User Table and holds a single expense detail (date, amount, receipt info, etc.)

And then use Joins, Groups, and such to organise it for retrieval.


这篇关于建议我更多行或更多列将是最好的。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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