I would like to concatenate 2 strings/fields from a table into one additional attribute and have it wrapped around the “ ‘ ” character using an sql select statement in oracle. This statement select …
Tag: sql
Best way to store attendance and get difference of time in MySQL?
I’m very new to the SQL language and MySQL. I’m working on a little Time and Attendance application IN PYTHON. What it does is logs the clock in and out time. Then calculates the hours worked and …
SQL Format(‘MMMM’) does not work in SQL Server 2008
I had this query select format([time], ‘MMMM’) as ‘Month’, count([time]) as ‘Application Usage’, count([time]) as ‘Application Usage’ from UserLogs UL where [time] >= …
Impala SQL LEFT ANTI JOIN
Goal is to find the empid’s for a given timerange that are present in LEFT table but not in RIGHT table. I have the following two Impala queries which I ran and got different results? QUERY 1: select …
Why does my data from SQL table delete after I run this code?
I have this code that I want to run and it’s connected to my database and it uses to show the values on the table but every time I do an UPDATE query. It updates the rest of the row with zeros except …
Trigger to delete rows from table
I’m trying to create a Trigger for when records in a log table exceed a certain number of rows I want to start purging them by x amount of old records and keeping the new records by a certain date. …
SQLite3 syntax error on tested sql script
I’m using python 3.6.4 and sqlite3 2.6.0 to query the nearest consecutive dates in my table in a sqlite 3.27.2 file. I’ve tried to get the actual sql string with vscode debugger and test it with DB …
Translate Excel business logic to T-SQL
I need to ‘translate’ some business logic from Excel to T-SQL, I’m having a hard time with it. It’s about figures from gates that count how many customers go IN and OUT of the stores. All DATA you …
How to convert Row to Column using Pivot?
I am trying to convert rows to column This is my table records Records SrID ProID Year Qty Months ————————————- 4444 112112 2019 22 THREE 4444 112112 …
Select Min Date value from subquery to main query
I’m trying to get the min Date value as a column in the main query where the main query & the subquery have inner joins & the min Date value is dependent on grouping of 3 columns from the main …