Skip to content
Advertisement

Tag: sql

Microsoft Azure database admin user creation

I deployed azure MySQL 5.7 database in azure. I can’t create another admin user with admin permission with the serveradmin login. When I tried below command GRANT ALL PRIVILEGES ON . TO ‘sammy’@’localhost’ WITH GRANT OPTION; I am getting error serveradmin@ip don’t have enough permissions even though I am user server admin login. Is this because of Microsoft Azure database

How to append nested key-value to json array in postgresql?

My json values in jsonb column are below: I have nested key – “Images” that has array of strings. How to write query that will add to Images new keys/values (“UploadedBy”:null and “Size”:null) and transform array of string to key-value (“https://face.png” -> “Link”:”https://face.png”) like below: Answer You can use jsonb_set: See fiddle.

how to get the sql data in reverse order of rows

i have a source table desired result output— i was trying something like this is this is a simple way to write or any better ways to write ? Answer We can use CASE expressions to find each distinct source destination pair:

SQL: Capturing first row in WHILE loop

I’m thinking my issue is based on how I’ve written the loop, but how it is written is how I’ve come to understand loops. So I’m really wondering if there is a way to consolidate this? As it sits, I have 2 sections: the first which captures the very first row, and it exists solely because my second section will

Create a new double-field based on the existing string-filed

There is an SQL query forming a table. It is necessary to form another double-number field based on one of the string fields in the table. Values of the original string field (BRLOADSTA0): Values of the resulting double-field (BRLOADSTA9): The request which I’ve create: Full snippet: Thanks in advance even for trying to help 🙂 Answer Could you tell us

Postgres Query Using Join Table

I have 3 tables: users, public_pictures, pictures Import properties: users.id public_pictures.user_id public_pictures.picture_id pictures.id public_pictures is a join table between users and pictures with only those two properties above. Both are foreign keys to their respective table. Given a user.id, I want to get all their public pictures. I tried something like: but this just returns all the user’s images instead

Re: MySQL 8.0 Command Line Client Error 1205

MySQL 8.0 Command Line Client is giving me a timeout error and I have restarting the transaction by typing “start transaction” another time. Keep in mind that I have another command line open with the table CIA_DATA.new_table and it is also being updated with the same changes. (I am doing this to follow a tutorial.) Here is the script: Updated

Advertisement