this is my current query
cursor = connection.cursor()
cursor.execute('SELECT *'\
'FROM students' \
'WHERE numberofclasses > 4')
list = cursor.fetchall()
now I wish to add to the string:
- that
registrationdate
was in the past month --> how do I calculate and add the result to the string - the name starts with 'l' --> how do i add
name like '%l'
into the above string
Note:
- it's important for my question to keep the string format of
'...'\ '...'\
and not write it in between''' ... '''
- this is an example for a much complicated query that must be executed this way and not through Django ORM platform.