Skip to content

Tag: sqlite

SQLite – Combining Rows into New Columns

I am attempting to create a chatbot in Python 3.9 using my own text messages, but am having trouble formatting my data correctly. I have a table of text messages that looks like this: row_id Type Date Text 1 Incoming 2020-08-10 08:09:18 Hi 2 Outgoing 2020-08-10 08:11:04 Hello 3 Incoming 2020-08-10 08:11:12 Fo…

strftime() with not giving the correct results

I have this table: I need a way to only show records besides the current month and year. example: today is 2021-01-08 I only need to see records besides month 01 and year 2021 This is my sql fiddle playground I do not understand why it doesn’t output the result I want. I need it to show me this: Answer

python sqlite3 partial search

I want to do a partial search with python sqlite3. My initial query is: Then I tried using the LIKE keyword and string formatting to obtain partial search results for the title, like this: As in https://stackoverflow.com/a/20904256/13290801 This seems to do the trick for title, but now when searching on the o…

Query slow in Web App, but fast in command line

I am need to retrieve records from two tables which are linked by a third. Session content doesn’t contain any information I need besides the keys to link the other two tables. I am currently using these joins: It only takes 50 ms in SQLite DB browser, but takes multiple seconds of buffering when I call…