Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

flask sqlalchemy remove duplicates

mylist = db.session.query(User.name).all() # get all user.name from db
mylist1 = len(list(dict.fromkeys(mylist))) # remove the duplicate then use len() to find total
 
PREVIOUS NEXT
Tagged: #flask #sqlalchemy #remove #duplicates
ADD COMMENT
Topic
Name
9+1 =