I am working on a project management website and have been asked for a new feature in a review meeting section. A meeting is held to determine whether to proceed to the next phase, and I need to maintain a list of who attended each phase review meeting. I need to write an SQL query to return all people, with
Tag: sql
I can’t get specific row’s postition in table using order by in MySQL
I want to get position of specific row in MySQL table using operation ‘order by’. Let’s say i have this table: And now i want to order them by user_points (ascending) and get Ann’s position in here. The output I desire is ‘3’. I was trying to do it, but with no results… If anyone has any idea how to
Indexing an SQL table by datetime that is scaling
I have a large table that gets anywhere from 1-3 new entries per minute. I need to be able to find records at specific times which I can do by using a SELECT statement but it’s incredibly slow. Lets say the table looks like this: I’m trying to get data like this: I also need to get data like this:
Execute different WHERE statement based on IF conditions depending on @variable?
I have a nativeQuery in my DAO layer inside my Spring Boot app. Basically, I’ passing three parameters, like so: I would like to have different WHERE statements executing depending on value of companyName, something like this: Or Answer Use boolean logic:
Orderby on multiple columns using typeorm
In my application, I am using MySQL and typeorm and want to do orderBy using multiple columns. I searched so many places for it but did not get any solution. Example: I have two columns in a table user and respective User Entity ________________________________________ | id | name | createDate | createdTime | —————————————- | 1 | Sai | 2020-12-12
How to get related field with typeorm?
In typeorm I run this code and the results are without lastApprover and managerApprover fields. I need those properties to be in the object. what I need to change to achieve that? This is my code: task.ts user.ts: Answer Try to add relations
Insert 2 select in same insert SQL
i have a problem, i would like use 2 select to insert in new table but i don’t know if it’s possible… my code : I would like insert the second part ( select COLONNE01….) in the first part instead of “INSERT HERE” DATA OLD TABLE : COLUMNS 1 (“PKID1″, one”,”two”,”three”) COLUMNS 2 (“PKID2″,”one”,”two”, “three”) New TABLE : (PKID1, one,
ORACLE SQL – How to add commas and dollar sign to a table value
For this, I am trying to display my table values in a currency format, here’s my code; This is what I get; This is what I want; So pretty much format the values with a ‘$’ sign and automatically add a ‘,’ where appropriate. I am very new to this so I apologize if this sounds dumb in any way
datetime.datetime conversion to datetime
I have defined a column in SQL Server as ldate with datetime data type and accepting null values. I’m trying to send data from my local machine using python and pyodbc. I have date like 20-01-2015 in string format. When I try to send data it throws an error: pyodbc.DataError: (‘22007’, ‘[22007] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Conversion failed
How to make a query that may combine COUNT(*) from one and some attributes from the other one
I’m starting to learn some SQL and at the moment I’m having some issues making a query. I have two tables: coursetbl: This table has a courseSectionNum, StudentID, courseID, classroom, meetDays, sitNum, beginTime, endTime. I’m interested in courseSectionNum, classroom, meetDays, and both the times for records that have a courseID of 240. enrolltbl: This table has courseSectionNum, courseID, StudentID, and