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-01873 when calculating the difference between two timestamps
I am trying to produce the number of days between two timestamps, as a precise fractional number. My code is producing ORA-01873: the leading precision of the interval is too small This single line …
Charting the data from database and merging row with the same value
I want to create chart that read the category column in my database.. I have repeating category because its general term and i notice this. I have many “short” slice: I dont have any idea how to …
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 …
Query to “PIVOT” the results of SalesAmount & CumulativeMonthly for specific YEARS
I have a database table that captures every Sales Transaction: Transactions ( ID INT, TransactionDate DATETIME, SalesAmount MONEY ) I need to run a T-SQL query to produce a Sales …
Count of difference in values by date
I have a data set that contain two columns [date, cust_id]. date cust_id 2019-12-08 123 2019-12-08 321 2019-12-09 123 2019-12-09 456 There is a high churn rate for my customers and I …
Selecting unique players’ scores from two columns with bubble sorting
I have a very interesting challenge that I’m either looking too hard at (and missing a simple solution), or it is more complex than I can figure out heh Essentially, I have a game that tracks scores. …
Selecting zipcode that is stored in string as numberic range (hive)
I’d like to select people who live in california zipcodes. However this table i’m using stores zipcodes as string, instead of integers, so I havre to put a qutoe around it. How can I select these …
postgresql: how to import data from two separate tables into a single table into the SAME row?
I am using postgresql to create countries table from single_sales_records. single_sales_records looks like this: sales_id |region |country| ——…
ORACLE CREATE TABLE with FOREIGN KEY error
I am a beginner to Oracle and have been having problems creating a table with a foreign key, I have created the parent table region as well and have been receiving the same error. I have researched on W3school and used the same syntax but still no help. Answer Leave “FOREIGN KEY” out, if you want …