Home > database > [with] about the two tables, for the realization of the same field data to heavy
[with] about the two tables, for the realization of the same field data to heavy
Time:09-26
The current business involves two tables 1. The order log tables, including field XZPHONE 2. The activity log table, including field PHONE_NO
CodePudding user response:
1. The first timing task For the first time I will go to check the order log tables, obtaining normal mobile phone number, call interface activation number, and carry out activities, and will activate the result (success) and the activity to transact the results added to the activity log tables:
2. The second time the task
I will go to the query activity log activation failed cell phone number in the table, to be dealt with again activity
Will there is a question
My mobile number to success in the first access to state and a second access phone number will be repeated for activities, so I'm query a phone number for the first time, to rule out my conduction activity failed mobile number;
CodePudding user response:
Because I activities to deal with mobile phone number has failed another time running, the mobile phone number to deal with failure, but he has successfully, the order status in the table is normal, the first task will be run regularly. I need to rule out the active log the mobile phone number in the table
CodePudding user response:
SELECT T.X ZPHONE AS PHONENO FROM T_YWXH_LOG T WHERE T.X ZPHONE NOT IN (SELECT T1. PHONE_NO FROM T_YWSK_ACT_LOG T1 WHERE T1. The STATE='1') AND T.S TATE='0' AND T.D SSTATE='0'
This is my own SQL, although solved, but I feel is not the optimal way, consult everybody