Get Array Index from JSON data SQL Server
{ "Name": ["dokumen_1","dokumen_2","dokumen_3","dokumen_4"], "Date": [0,0,0,0], "Progress": [0,0,0,0] } I want to fetch Date and Progress value according to Name position.
{ "Name": ["dokumen_1","dokumen_2","dokumen_3","dokumen_4"], "Date": [0,0,0,0], "Progress": [0,0,0,0] } I want to fetch Date and Progress value according to Name position.
Having a couple of syntax errors in this code. I am having the "Loop is not valid at this position expecting if" at "loop", "statement is incomplete" at "END$" and "@commission is not valid at this position". DELIMITER $$ CREATE…
Is there a performance difference between doing a self-join vs. case expression when filtering a large table? For example, I have a list of names and professions, and I want to create a column that is only populated if a…
I have transaction table with columns transaction_id, transaction_category and transaction_quantity. Please view the sample data below transaction_id transaction_category transaction_quantity 112 sale 1000 112 internal 1000 113 sale 1000 114 sale 1000 114 internal 1000 115 sale 1000 115 external 1000…
I am trying to calculate the percentage of the row events when the value is null. I have a table with 2 rows (zip_code, events). TABLE weather events TEXT zip_code INTEGER This is the query I wrote. I am just…
First I get my SQL query result that I put in an array like this : $stmt= $conn->prepare("SELECT p.*, f.* FROM fruit f left JOIN person p ON f.fk_p_id = p.p_id "); $stmt->execute(); $result= $stmt->get_result(); while ($data= $result->fetch_assoc()) { $arr…
I'm painfully new to SQL/mySQL as a whole so I'm flying blind right now so apologies. I made a procedure in mySQL that selects a varchar data from a specific column and table, turn it into INT (contents of said…
I have a table user_test_access which stores test_id and user_id. user_test_access table stores all the uses who have access to the test as well as which user created the test. id test_creator test_id user_id 1 0 1 901 2 0…
I have this PostgreSQL table for storing words: CREATE TABLE IF NOT EXISTS words ( id bigint NOT NULL DEFAULT nextval('processed_words_id_seq'::regclass), keyword character varying(300) COLLATE pg_catalog."default", ) insert into words (words) VALUES ('while swam is interesting'); CREATE TABLE IF NOT…
I have a query that works perfectly, however I need to change it a bit but it shows me an error and I can't figure out why. Below is the code before and after the changes I made: BEFORE: SELECT…