Query works but cant retrieve the data

I am new to Node.js (3 days total experience). I am using Node.js and the tedious package to query a database (azure SQL). I use the example as explained here: https://docs.microsoft.com/en-us/azure/…

Count the amount of likes a user received on each post sql

I have two tables. Likes table which contains it’s like_id (PK), vole_id, user_id, and created_at timestamp. And another table called voles that contain vole_id (PK), and user_id, as well as a bunch …

How to pass a seed value to random order function in Sequelize

In SQL dialects you can sort by random and you can pass a seed to the random function in order to get a repeatable random order of rows. In MySQL you’d do it like this: SELECT * FROM `users` ORDER BY …

Make a SQL insert statement inside another [closed]

I’m creating a a workout app for a local gym, but I’m having a difficult time figuring out how to populate the workouts and exercises tables. Right now, I have a ‘Add Workout’ button that displays a …

Syntax error in SQL when inserting data via nodejs

I have a simple nodejs code in pipedream that sends the body email to mySQL Database. i have checked the connection to database and its working. Here is my code const mysql = require(‘mysql2/promise’);…

INSERT ON CONFLICT DO UPDATE using pg-promise helpers for multi row insert/update

I am trying to insert multiple rows to pgsql database using pg-promise. In my case, few records, which I am trying to insert, may exist already in the table. In such case, I need to update them. By …

sequelize updating multiple rows

Update multiple rows , is using a bulk update a good solution or something like the code below works ? . I supposed wanted to update all the records with the id and filename. I did try to update …

Select row by user_id and any row which share that entry’s event_id

I have a table which includes the following format: _______________________________ | event_id | user_id | username | |——————————-| | 30 | 1 | user1 | | 30 | …

How to get the value of selected option in html using find() in Node.js Express and mongodb

I’m trying to get a specific document in mongodb and I’m using find(). the problem is that it doesn’t give me the result that I’m looking for in the html file (for example: i choose MALE and XL which …

I want this query in Sequelize form

I am getting the output in RAW SQL but I am unable to do with SequelizeJS SELECT * FROM `tbl_a` a LEFT JOIN `tbl_b` b on b.b_uuid = a.a_uuid LEFT JOIN `tbl_c` c on c.c_uuid = a.a_uuid