Skip to content

Select and join with sequelize

How to make this code with the sequelize? I used include, but it brings all the user data but I only need the name my code: Answer If you just want to reduce User model attributes then just indicate needed attributes in the attributes option: If you want to add a user’s name as a string prop at the same

How to get only comma values in SQL Server

I have a employee table and I am trying to get only comma values in SQL Server. Emp table: Eid Ename 1 Peter,J 2 Mike,S 3 , 4 ,,,,,, I tried this code: I am not getting the length 0 if the values contain only commas. Expected result: I want only 3 and 4 emp ids. Answer The answer there

Add geometry column from exisiting x,y,z columns

I have a table as such: All columns are Decimal(18, 3), there are also millions of rows. I would like to add a fourth column to be a geometry point. I have tried but to no avail: Driving me insane! Cheers Answer As mentioned by @lptr in the comments, you can use STPointFromText db<>fiddle

How does a multi-column index work in MySQL?

More specifically, what data structure does MYSQL use for multi-column indexing? I know MYSQL use Btree for indexing, which can only index one column. How does multi-column indexing work then? Answer Think of a MySQL “composite” index this way. Concatenate all the columns in the index together, th…

Oracle Apex conditional icons on values in classic report

I have a follow up question based on this answer which is string based: https://stackoverflow.com/a/41556608/221270 How to achieve the same conditional color and icon formatting but based on a value: If I use the code above I got this error: ORA-20999: Failed to parse SQL query! ORA-06550: line 10, column 1: …

How to find days when workers don’t show up for work

I have a calender table for everyday in 2021. Also i have an entry table for workers everyday entries. It includes id and date columns. Calender just have date column. How can i find the days when the workers did not come? I thought searching days for every id would work Answer Left join the worker entries to…

How to increase performance when inserting more than 40k+ rows

My attempt: Currently, I am inserting a few records and it is giving exact results but in actuality, there are 40k+ records so I believe it will give performance issues also. Is there any way to insert the records faster because I will write a procedure for this insertion? Is there any other in which I can wr…