I am using python on a SQlite3 DB i created. I have the DB created and currently just using command line to try and get the sql statement correct. I have 2 tables. When I setup table two, I added this statement in the creation of my messages table, but I have no clue what, if anything, it does: What
Tag: sql
Define two or more conditions into a stored procedure with inner join?
First, I needed to filter the data from the tables TbTaxCompanies and tbCompany, through the variable @company_id… and works! And second I need to filter again the set of logs from the company selected previously with @company_id, but now to obtain only the latest updated taxes (only one row)… and…
Cyrillic symbols in SELECT query PostgreSQL
I have a telegram bot (Aiogram, Python), which is connected to PostgreSQL database. If user enters a some username (in Cyrillic, Russian or Ukrainian), bot should return full information about this user, stored in database. The problem is: when bot making query to the database, with username for example “Серг…
postgres sql query to convert group by result in multiple columns
I have two tables financial_account having columns account_name financial_transaction having columns transaction_date,transaction_type, transaction_amount I need data as SUM(transaction_amount) …
Grouping with order in complex data
I have data like this Name valuta price Type Type2 A USD 10 Acc 1 B USD 30 Acc 2 C SGD …
capture the starting characters with many patterns
I need to capture the starting characters from database objects with various pattern search. I have tried using the REGEX expression ,below query i am trying and the expected data set to be. Query 1 …
Big Query – Calculate start and end date back to back
I have a problem, which I need some advise, I am required to calculate the number of leave calendar days taken back-to-back on big query. (For eg. 2 leave records taken on 07-01-2020 to 10-01-2020 and 13-01-2020 to 15-01-2020, should return 07-01-2020 to 15-01-2020) However, there are certain weeks, where lea…
Speeding Up Access 2016 Query
I have a query that contains amongst other things batsmanIDs and League names (extract below). I have put together another query to return all records where a batsman has played in each of two Leagues. The query works but it is very, very slow. There are 48,000 records returned in the first query but when I u…
Delete all related rows to user using EF .NET CORE
I have little problem with data delete. Let s assume that I have to delete user and all related rows to this user. I wrote some code in c#, but it takes ages to complete. Here is my some of my code. …
Foreign and Primary Key Conceptual Questions
I am a newbie at SQL/PostgreSQL, and I had a conceptual question about foreign keys and keys in general: Let’s say I have two tables: Table A and Table B. A has a bunch of columns, two of which are A.id, A.seq. The primary key is btree(A.id, A.seq) and it has a foreign key constraint that A.id reference…