SELECT *
FROM table1 t1
WHERE (SELECT COUNT(*) FROM table1 t2 WHERE t1.country=t2.country AND t1.name=t2.name)>1;
list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
sum = 0
for i in range (0,len(list)):
sum+=list[i]
print(sum)
45
regexp1=re.compile('visa')
data=b'324234236436243 \n3423342342342342\n3423342342342342\n3423342342342342\n3423342342342342\n3423342342342342\nvisa\nvisa\n\n'
type(data)
out1=[i[0] for i in regexp1.finditer(data)]
Traceback (most recent call last):
File "C:\Python36\lib\site-packages\IPython\core\interactiveshell.py", line 3331, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-163-5c8508134c95>", line 4, in <module>
out1=[i[0] for i in regexp1.finditer(data)]
TypeError: cannot use a string pattern on a bytes-like object
out1=[i[0] for i in regexp1.finditer(data.decode())] #по умолчанию декод вроде использует utf, поэтому параметр можно не передавать
out1
Out[165]: ['visa', 'visa']