Can anyone share me some light on why my Oracle SQL Developer flagged my view as broken while it is actually working? It is not just 1 view, but 10 views have the same problem, they are all created in a different time, with subquery or joining to multiple tables and is always working fine. Thanks in advance! …
Selecting into a Table from a Join with Large Amounts of Data
I am trying to join two tables with the results filtered by a date range, and select the created join into a new table. There are two tables: one is about 500,000 records, but the other is about 150 …
How to pull data for past x weeks dynamically in redshift?
I have a below query which I run gives me the single count for previous week which is Week 43. Current week is 44 as of now. As of now the output I see is this which is for Week 43- Now I am trying to make this query dynamic such that it can give me count for past 6
How Do You SELECT Both With and Without a WHERE in a Query?
I have a single table, my_table, with data like the following: I’m trying to write a query that would both sum the number of accesses GROUP BY’d fruit and the total number of access for each fruit, but only the accesses for levels less than 4. A result for that query would be: I tried the followin…
SQL – left join performs cartesian/multiplies matched rows
I have a very simple example but can’t understand why final result of LEFT JOIN returns 4 rows with value 3. Do I understand correctly that LEFT returns as many results for each row in left table as many matches it finds in the right table? (nb of rows times x nb of rows in right table). If yes, why
PostgreSQL / express rookie – create new table or just a new column in existing table? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question This will probably get closed for being opinion based but hopefully I can get a comment or t…
How to SUM two SUMmed SQL result fields
I have a simple table structure holding records of reagent_bottles and reagent_aliquots. Aliquots are created from bottles, and an aliquot record got a foreign key, bottle_id, to a bottles id. To get the total volume of a particular reagent (counting both the volume in the bottles and the volume in the aliquo…
How to find missing data in table Sql
This is similar to How to find missing data rows using SQL? and How to find missing rows (dates) in a mysql table? but a bit more complex, so I’m hitting a wall. I have a data table with the noted Primary key: I have a products table with all products, a countries table, and a calendar table with all
Executing view within a stored procedure
Is it possible to execute a view with a stored procedure? My procedure should first run the views (I have 2 in total) and then am combining these 2 views data into a different table for applying transformations. Something like this: Answer What do you call “execute a view with stored procedure”? H…
Add one year to age based on date BigQuery
I have a table containing birthday information: I’m trying to calculate the current age but only want to add on a year when the date is 12-01. For example the first row was born in June, 2016. The current age should be 3.5 and come Dec 1, 2020 the age would increase to 4.5. So I only want it to