Skip to content

Tag: sql

How to use ANALYZE EXPLAIN in a with_something query

I’m trying to find out how to use ANALYZE EXPLAIN on my PSQL query. If I add ANALYZE EXPLAIN SELECT, I get a syntax error. I have no clue how to use it. I added the ANALYZE before the first and second SELECT, but both throw a syntax error. I was unable to find different examples but on documentation, I

Data Model for multiple checkboxes

I currently have a supplier table and now I want to store the regions served by each supplier. As a first thought, I made my supplier model like this : Does this seem to be a good pattern? Especially for queries to filter suppliers by region served etc. Is this solution still reliable if in the future I want …

translate query from Oracle to Postgres

I need to translate this query from Oracle to Postgres: can someone help me? thanks in advance for your attention and support Answer In postgres the operateur ~ performs a regex comparison as thus replaces the Oracle function regexp_like(). Your query therefore becomes. I would like to alert your attention th…

Increment column value based on condition

I’d like to increment the values in the column nc by 1 each time the value in 10minDiff changes. In the Table below, the values in nc should read 2 from row 1246 onwards and 3 the next time 10minDiff changes from 10. Answer Since data is not textual.I am writing UnTested query.

How to use get value from multiple tables using left join?

I have these 3 Tables. Now I need to show the timezone name from the timezone table in the Devices Table by using left join. How can i do that? Please Help Table Name : [pbi].[GEOTAB_INFO_GROUPS] Table Name : [adl].[GEOTAB_VEHICLE_INFO_DEVICES] Table Name : [pbi].[Location_Time_Zone] I Am trying like this but…