Skip to content
Advertisement

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 For tomorrow 4 Incoming 2020-08-10 08:11:20 Are we

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 other parameters, it’s not working at all although there

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 the related API endpoint.

How to merge two tables and sum the values with the same ID in SQL?

I am new to SQL sorry if the question ends up being trivial. I have two tables: Table 1 “Clients”: Table 2 “Payments”: Desired Output: Here is what I have tried: This sums the entries in table “payments” with the same ID. However, I don’t know how to use the ID in order to have Name and Surname in front

Advertisement