如何在数据库中维护客户的旧地址和当前地址 [英] How to maintain old addresses and current address of a customer in database

查看:73
本文介绍了如何在数据库中维护客户的旧地址和当前地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我需要你的帮助,请帮助我。如何在数据库中维护客户的旧地址和当前地址。即当客户注册时,我们会存储他的详细信息。我们使用当前地址为该客户创建发票。现在客户更改了他的地址。我们想要商店旧地址和新地址。

Hi All,
I need your help, Please help me. How to maintain old addresses and current address of a customer in database. i.e. When customer register we are store his details.And we creates invoice for that customer with current address.Now customer changes his address. We want store old address and new address.

推荐答案

首先,您需要在表中添加一列,即

Updated_Address。



i假设您有两种不同的创建和更新方法。

so当您要更新记录而不是当前地址时字段你可以使用Updated_address字段并保存它。



i只是假设你有两种不同的方法,但如果你发布你的代码,那么我肯定会提供正确的解决方案。
First of all you have to add one more column into your table i.e
Updated_Address.

i assume that you have two different method for create and update.
so When you are going to update a records instead of ur current address field you can use Updated_address field and save it.

i just assume that you have two different method for it but if you post your code then i definitely provide correct solution.


有一个单独的地址表。在该表中存储创建日期。选择要使用的地址时,请选择具有最新日期的地址。使用客户ID将地址表链接到客户表。
Have a separate address table. In that table store a "created" date. When selecting what address to use, select the address with the most current date. Link the address table to the customer table with a customer ID.


这篇关于如何在数据库中维护客户的旧地址和当前地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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