I have an SQLite database of TimeRecords. When a new record is created, no EndTime is provided. I want to retrieve the first record where the EndTime was not supplied and assign it to a new TimeRecord EndTime is stored as a DateTime variable. My Current Query Calling the Query I have done some research and di…
SQLAlchemy Column Types As Generic (BIT Type)
I am trying to list out the columns of each table in an MSSQL database. I can get them fine, but I need to turn them into generic types for use elsewhere. (Python types would be more ideal but not sure how to do that?) My code so far works until I come across a BIT type column. I get
Recode column values in MySQL
I am dealing with a column named UCODE130 that has values anywhere from 1-130. I would like to replace the values with ranges. For example, I want to replace any 1, 2, 3, or 4 found in that column with a string “1 – 4” instead. I do not want to do just a select statement – I want to
SQL Concatenate column values and store in an extra column
I am using SQL Server 2019 (v15.0.2080.9) and I’ve got a simple task but somehow I am not able to solve it… I have a little database with one table containing a first name and a last name column …
How do I get all dates between start date and end date for each task?
In oracle database, I have a table stored TASK_ID, TASK_START_DATE, TASK_END_DATE. How do I create a table with each row showing TASK_ID and DATE? (DATE being each day from start til end) TASK_ID …
optimizing database record fetching time
i have 2 kind of big database tables : [product] and [product_position], a product may change position so i use a function product_pos(product_id) to get the current (meaning last) position of a said …
How to use WHERE CLAUSE in Codeigniter 4
Hello i have 2 tables Student & Faculty i want to call them to my index(view), So I figured how to join them. but I have a problem, I need to divide these 2 tables into a category but I don’t know …
MySQL how get middle point between two given times
I have 2 times value 06:00:00 and 14:00:00 expected result is 10:00:00 FYI. I want to write this into my trigger Answer You can convert your times to seconds, then find the middle value, and convert back to time The middle value of two numeric values is simply (a + b) / 2
How to bring rounded integer as output by multiplying two columns in SQL
I have two columns A and B in SQL. Column A has value 5.2 and Column B has value 2.1. I am multiplying column A and B in Column C. Answer is 10.92. I would like to get rounded number 11 as Integer in …
postgreSQL LEFT and UPPER interaction
Question: Write a query that returns the name, address, state, and zipcode from all purchases. For the names, return only the first 5 characters, and display them in all uppercase letters, sorted in alphabetical order. Code so far: I’m at a loss of where and how to use UPPER to capitalize all the charac…