Skip to content
Advertisement

Laravel SQL Query. Help me

I have a table name “Offers” with 3 (public, request, private ) types of data. Now I want to show directly to the user end public and request offers. and private offers not be shown but when admin …

LEFT JOIN ON string match Very slow

I have to perform this LEFT JOIN but it’s very slow (30.000ms) because of the match on text string. How can I make it faster? SELECT * FROM table_a LEFT JOIN table_b ON ( table_b.state = ‘…

How to get occupation of a month?

I have a reservation system but now I want to calculate what the occupation of a room in a month is. But I’m having trouble with getting accurate results because if a reservations start date is at f….

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’

Advertisement