I have a list of names in Mysql Database and i want to sort them according to the first alphabet.
When i run this code i get the sentence in the Quotes printed out
import sqlite3
import csv
conn = sqlite3.connect('RefinedDatabase.db')
cursor = conn.cursor()
selectRow = cursor.execute( "SELECT Lecturer FROM staffDataBase")
fetchrow = cursor.fetchone()
while fetchrow != None:
fetchrow = str(fetchrow).replace(',)','').replace('(','').replace('u\'','').replace("'","").replace('u"', '').replace('"','')
fetchrow = 'SELECT lecturer FROM staffDataBase ORDER BY lecturer'
print fetchrow
fetchrow = cursor.fetchone()
conn.close()
print ("All Done!!")