MySQL statement--string multiple substitution, 7th row weight

Source: Internet
Author: User

Multiple substitution of strings: (replaced four times)

SELECT
Replace (replace (replace (
T5,
Substring
T5,
LOCATE (' &timestamp ', T5),
24
),
‘‘
), SUBSTRING (
T5,
LOCATE (' &accesssignature ', T5),
47
), "), SUBSTRING (
T5,
LOCATE (' &time_stamp ', T5),
25
), "), SUBSTRING (
T5,locate (' &access_signature ', T5),
48
),‘‘)
As Temp
From
V2-api-log

Replace (column, the string to be replaced, the string to be replaced)

7th Row Weight:

CREATE TABLE new_table (
SELECT
t1.*
From
tmp_table T1
JOIN tmp_table t2 on t1.temp = t2.temp
and T1. T1 = t2. T1
and T1. T6! = t2. T6
WHERE
ABS (Date (T1.DAYTEMP)-date (t2.daytemp)) <= 7
GROUP by T1. T5)

The demand is the row weight, after the time according to two duplicate data whether within 7th, if within 7th even if repeat, if not in the count.

The idea is a table when two tables are associated with a query

MySQL statement--string multiple substitution, 7th row weight

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.