Home > database >  PB issue of data table
PB issue of data table

Time:10-12

Hello, everyone, I want to through SQL statements fill KXRQ content, using the same number, according to a month to date, operation record 1, no bank record 0. Eventually want KXRQ field content updates for 11000... 001, in order to see that some trains in operation the number of days in a month, consult how to do? In April 1133, for example, only 20 and 21 operation, should be 000000000000000000011000000000.  .

CodePudding user response:

000000000000000000011000000000
This value is how you work out? No see for a algorithm

CodePudding user response:

Understand the value is the number of days a month, I think about how to do a cycle

CodePudding user response:

If you only use SQL statements do:
Set up a temporary table, insert a value default is 0
The create # LSB (
Day1 varchar (1)
Day2 varchar (1)
Day3 varchar (1)
.
.
Day31 varchar (1)
)
And then through the cc column loop for CCRQ intercept CCRQ month and day, according to the month to determine how many days the month, according to the day to update # LSB corresponding as 1.
Finally according to the days of the month (e.g., 30 days) make a list of top 30 # LSB pieced together, is the value you want

CodePudding user response:

Suggest you don't convert numerical, define the field into a character directly, such as varchar (50), and then direct store this 000000000000000000011000000000, more intuitive, more convenient to parse and

CodePudding user response:

Trains do cross ~ + date water with month date

CodePudding user response:

In the host language processing, should be very simple

CodePudding user response:

Didn't understand why the statistics' some trains in operation within one month of the number of days' 'why do you want to use this method, on the other hand, in the PB, or write a stored procedure, should be very simple
  • Related