在SELECT中的MySQL IF,替换'AAA'上的字母'A'

时间:2017-05-14 17:46:19

标签: mysql sql

如何显示雇主列表,以便如果找到名称字母'A',系统已在'AAA'上替换此名称? Screenshot

1 个答案:

答案 0 :(得分:0)

正如@shmosel所说,你可以使用REPLACE函数和UPDATE

import boto3

region_name = 'us-east-1'
aws_access_key_id = 'YOUR_ACCESS_KEY'
aws_secret_access_key = 'YOUR_SECRET_KEY'

PAGE_SIZE = 20

endpoint_url = 'https://mturk-requester-sandbox.us-east-1.amazonaws.com'

client = boto3.client('mturk',
    endpoint_url = endpoint_url,
    region_name = region_name,
    aws_access_key_id = aws_access_key_id,
    aws_secret_access_key = aws_secret_access_key,
)

qualification_id='9W4ZQKNWM3FZ5HGM2070'

response = client.list_workers_with_qualification_type(
        QualificationTypeId=qualification_id,
        Status='Granted',
        MaxResults=PAGE_SIZE
    )
next_token = response['NextToken']

qualification_count = response['NumResults']
while (response['NumResults'] == PAGE_SIZE):
    print "Using next token of {}".format(next_token)
    response = client.list_workers_with_qualification_type(
            QualificationTypeId=qualification_id,
            Status='Granted',
            MaxResults=PAGE_SIZE,
            NextToken=next_token
    )
    next_token = response['NextToken']
    qualification_count += response['NumResults']

print "There are {} Workers in Qualification {}".format(qualification_count, qualification_id)