I'm looking to remove the names that are repeated.
My code is connected to retrieve information from SQL server to Python.
def get_all_artist():
query="SELECT artist_name FROM Sheet1"
all_artist = execute_read_query (conn, query)
for artist_record in all_artist:
print(str(artist_record[0]))
return (all_artist)
The artist_name that I am retrieving on SQL are:
BTS
BTS
BTS
TWICE
TWICE
TWICE
TWICE
TWICE
HEIZE
HEIZE
KHALID
KHALID
KHALID
ERIC CHOU
ERIC CHOU
ERIC CHOU
SAM SMITH
SAM SMITH
SAM SMITH
AGUST D
However, I'd only like to remove the duplicates on Python without removing any rows in my SQL table:
BTS
TWICE
HEIZE
KHALID
ERIC CHOU
SAM SMITH
AGUST D
"SELECT UNIQUE artist_name FROM Sheet1"