In my app I have users and invoices (amongst other things). I’m not sure what’s the best way to make sure the invoices of every user start with 1 and go up incrementally. For example: User 1 makes …
Tag: database
Query can not be executed, or waiting too long
I am using MySQL 5.0 and working with some crowded tables. I actually want to calculate something and wrote a query like this: SELECT shuttle_payments.payment_user as user, SUM(-1 * (…
ORA-00942 with cx_Oracle
I’m trying to run any command on an autonomous database from oracle cloud after establishing connection but they don’t seem to work. cursor.execute(“select * from admin.customers”) gives me the …
Get least 10 values in mysql query
I have a table in mysql. Table Name is constitutive_table, it contains more than 40 columns and its type is varchar, it contains more than 25000 records. I wrote the query like this to get the 10 …
How to run a query for current date for date partitioned tables?
I have a table that is partitioned by date so something like ‘tablename_20191205’. Is there a way for me to run the query everyday without having to modify the date? Also how would I do this if I am using two tables. So instead of typing, Select * From ‘tablename_20191205’as table1 and ‘tablename2_20191205’ as table2 and modifying the date everyday.
How do i make a sql query using more than one tables with onde condition for each?
i want to get some data from a table but separated by different conditions, for example how many lines have a column are equal to 1, how many have a column equal and the same until the number 5. i did …
Java + Postgresql : How to store Parent and List of all children in a HashMap>
I have an sql table Children : | ParentName | ChildrenName | ——————————————————————————— | parent 1 | child 1 | | parent 1 | child 2 | | parent 2 | child 3 | | parent 1 | …
PostgreSQL multiple join
I would like to make multiple joins in one query, I have four tables for that with the following structure: Table 1 fields, t1: did (int), finished (datetime), userid (int) Table 2 fields, t2: userid …
How to optimize a MySQL query which is taking 10 sec to fetch results
I have a MySQL database. I have a table in it which has around 200000 rows. I am querying through this table to fetch the latest data.Query select * from `db`.`Data` where floor = “floor_value”…
MySQL sum() from more than 1 table
Ok, so every sum() returns the desired value, I already checked it but I’m having problems when trying to sum everything together and then get the total value. Basically I have to do this: initial Fee(which is a set value defined on the”customer” table) + sum of activity1 cost + sum of activity2 cost == value But I don’t know