Querying A Date Column
In this example we are going to display the
name and grade of students who have born in the year 2001
Example
import sqlite3
connection =
sqlite3.connect("Academy.db")
cursor = connection.cursor()
cursor.execute("SELECT
Rollno,sname FROM student
WHERE(Birth_date>='2001-01-01'
ANDBirth_date<='2001-12-01')")
result = cursor.fetchall()
print(*result,sep="\n")
OUTPUT
(5, 'VARUN')
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.