Skip to content
Advertisement

Tag: sql

Join Tables to return 1 or 0 based on multiple conditions

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

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

Advertisement