Skip to content

Display number of town visited for each driver

I’m actually trying to have a number of time that a driver visited a town. I’m close to have the good result, but I need a little bit help to achieve this. So here it is my database TABLE_NAME …

How to help implement more logic in my joins?

I have some logic currently in my sql statement that takes away all punctuation so I can compare the two fields easily; however, I am having an issue now where my A table has a bank name of BBVA …

Getting JSON Array elements as records

I’m trying to extract elements from a simple JSON array in a PostgreSQL table like: id(int) vtags(jsonb) ——– ———————– 1 {“tags”: [“a”,”b”,”c”]} 2 {“tags”: [“x”,&#8221…

SQL: Add some validation steps for phone number

I have a fairly simple bit of SQL code that’s truncating three fields into one called “phone_number”: Select pp.country_code_number||pp.area_code||pp.phone_number AS phone_number What I’d like …

Join the records with sql?

I have a table with those 5 rows. code | type_id | status —–+——–+——– 123 | 123456 | DONE 123 | 456789 | DONE 321 | 654321 | DONE 321 | 897321 | DONE 456 | 999888 | DONE 456 | …