如何依次编号... [英] How to number in sequence...

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

问题描述

大家好


我在一个包含7列的数据库中有一个表。数据按日期降序排序。


对于每个pid我想要输入序列号

第一条记录有两个条件

如果string 2为null则从sequence1开始编号

如果string 2不为null则从sequence2开始编号

如果string 2 = string1则

Sequence1 = 0

第二条记录有两个条件

数字序列2的值为2或3,具体取决于第一行

如果string 2 = string1 then

Sequence1 = 0

Else

Sequence1 =下一个号码

其他相同条件记录


谢谢


Raghu

Hi All

I have a table in a database with 7 columns. The data is sorted by Date1 in descending order.

For each pid I want to put the sequence numbers
First record has two conditions
If string 2 is null then start numbering from sequence1
If string 2 is not null then start numbering from sequence2
If string 2 = string1 then
Sequence1 = 0
Second record has two conditions
Number sequence2 with the value 2 or 3 depending on the line one
If string 2 = string1 then
Sequence1 = 0
Else
Sequence1 = next number
Same condition for the rest of records

Thanks

Raghu

Attached图像
Untitled.jpg (22.0 KB,186 views)
Attached Images
Untitled.jpg (22.0 KB, 186 views)

推荐答案

排序后只显示序列。基本上它不能知道序列,直到数据生成之后的一个点(这是有道理的,因为数据库理论适用于集合论,订购和排序不是其中的一部分)。


报告可以给出序列号,因为它们是显示有序数据的对象。正如我所说,查询和表应被视为项目的集合。不是一系列项目。
There is only a sequence when shown after sorting. Essentially it cannot know the sequence until a point after the data has been produced (This makes sense as database theory works on set theory and ordering and sequencing are no part of that).

Reports can give you sequence numbers as they are objects that display the ordered data. As I say, queries and tables should be considered as a collection of items. Not as a sequence of items.


非常感谢所有评论和回答的人。基本上这些都是某些交易。


其中sequence2和date2为空白表示交易是开放式的。


其中sequence1和sequence2与交易相同事件结束后收到了结果。


如果sequence1和sequence2不相同,则在输入开始交易后的某个时间输入结账交易。


这个练习的目的是我必须创建一个字符串来以编程方式删除大量的事务。


我有6,000个pids和300,000个要删除的事务本财政年度结束即30JUN15 ..


Raghu Prabhu
Thanks a lot to everyone who has commented and answered. Basically these are certain transactions.

Where sequence2 and date2 are blank indicates the transaction is open ended.

Where sequence1 and sequence2 same the transaction was close ended and the input after the event.

Where the sequence1 and sequence2 are not the same, the closing transaction was input sometime after the opening transaction was input.

The object of this exercise is I have to create a string to programmatically delete a huge number of transactions.

I have 6,000 pids and 300,000 transactions to delete before the end of this financial year ie 30JUN15..

Raghu Prabhu


这似乎是一个完全不同的问题。不幸的是,虽然你现在提供更多的信息,但仍然有很多不清楚。
  • 我会假设PID识别必须一起考虑作为一组的交易组。
  • 示例中的所有值都没有[Sequence2]为空。我们是否应该假设没有一个是开放式的,或者你是否意味着如果两个[Date2]和& [String2]是空白的吗?
  • 所有字段实际上代表了什么?
  • 当我们真正知道它们正在处理什么时,有哪些规则可以确定交易应该被删除?
This appears to be a question of an entirely different sort. Unfortunately, while you give much more information now, there is still much that isn''t clear.
  • I would assume that the PID identifies groups of transactions that must be considered together as a set.
  • None of the values in your example have a [Sequence2] that is blank. Should we assume none is open ended, or did you mean to say that it would be open endeed if both [Date2] & [String2] are blank?
  • What do all the fields actually represent?
  • When we actually know what it is we''re dealing with, what are the rules that determine that a transaction should be deleted?


这篇关于如何依次编号...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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