I have a stored procedure which uses different tables for a join based on an input parameter. Currently I have to write the SQL query twice (with only the table name difference). Is it possible to …
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 …
Does ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter#quote protect against SQL injection?
Does this method protect us against SQL injection? https://www.rubydoc.info/github/rsim/oracle-enhanced/ActiveRecord%2FConnectionAdapters%2FOracleEnhancedAdapter:quote
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 …
Need to get difference between these two as output
REQUIRED QUERY : select all memberid from query 1 having higher count than query 2 the aim is to display all memberid who were leader/organiser/helper more times than they participate in event how …
Grouping other fields by common email
I’d appreciate any assistance people could provide with this one. I’ve tried to follow a couple of other posts (GROUP BY to combine/concat a column), but when I do this, it combines everything. I …