I use this SQL query to insert 1 row of data: Is it possible with 1 SQL query to insert 100 rows with random data into Postgre table? Answer
Tag: postgresql-9.3
How to create a sequence in a specific format in postgresql?
I want to automatically generate an unique entity field in Postgresql in following format: “ССDDD” where “C” is a character and “D” is a digit. For example “FG1752” or “HK9273”. How can this be implemented? Answer here is one way in mysql : in postgresql: I’m producing a random number between 65 and 90 which are ascii code for A
‘cannot extract element from a scalar’ when order by id is DESC
I have a PostgreSQL 9.3.10 database, a table with 15842 records and use Intellij for making queries. I want to query some recent data from JSON column (named ‘data’). My query is that simple: The problem is that I get: [22023] ERROR: cannot extract element from a scalar when I use desc order. When I use asc the query does
Split given string and prepare case statement
Table: table_name Insertion of records: Now I want to update set_name for some dates. For example: I want to update table like this: Note: The given_dates and set_name are pass a parameter because of they are dynamic. I may pass 2 sets as shown above s1,s2 or may pass 4 sets according to the requirement. So I need the dynamic
Query combinations with nested array of records in JSON datatype
I’m working on a Rails application that utilizes the Postgres JSON data type. I have a JSON column called data in a table called reports. Let’s say I have multiple entries like this: What I would like to do is return the different combinations of entries that have the same album, src, and background (NOTE: within the objects node, order