Skip to content
Advertisement

Tag: sql

Bizarre Oracle Error: ORA-00936: missing expression

I’m working with a large, complex query. I added a simple date filter to the WHERE clause, and now I get ORA-00936: missing expression Removing the rest of the query, and just selecting id with this single date filter still produces the error – so at least that narrows it down. Looking online, apparently this error is supposed to indicate

group by issue in sql

i’m trying to get in a new column the sessions who are between 08:00 and 18:00. You can see my last CASE in the CTE. For each date there should be a new column “TotalRestrictedSessions” which indicate how many session were on that particular date. If there are none, in this case i have to write 0. I suspect that

SQL request for a JSON file

I am using node-red and influxDB with it. Basically I am running node-red (which execute a python code), with node-red I am getting a data from gauge strain cell, and I have them with a json format as …

Query for array values within jsonb column

I have a jsonb column called chores in my work table with data looking something like this: [{“task”: “feed_dog”, “value”: “Daily”},{“task”: “mop_floor”, “value”: “Weekly”] There could be zero to dozens of tasks in the chores array for each user. How can I query by task name? For example, pull all records where at least one task is feed_dog. SELECT chores->>’task’

Simple SQL query returning null value

I just started studying SQL queries. I am practicing on this site: https://www.techonthenet.com/sql/joins_try_sql.php I want to find: “the name of the employee with the highest salary for every department”. My query is: And I get null value for first_name : I understand that the problem is due to the group by expressions. But how can I solve this? Tables: Answer

Athena geospatial SQL joins never complete

A very basic geospatial join, based on this example, times out every time. The table polygons contains 340K polygons, while points contains 5K rows with latitude/longitude pairs (and an ID). Both are single .csv files in S3. Query: The SQL query above never completes in the default 30-minute Athena query time limit. I’ve found vanilla Athena queries on large-ish data

Advertisement