I created a NETWORKDAYS-like function on sql based on this solution wich returns correctly the business days while the records (BEG and END) are on business days. BEG END businessd —-…
Lead and case expression
I have this table: ID Date —————– 1 1/1/2019 1 1/15/2019 Expected output: ID DATE LEAD_DATE ————————- 1 1/1/2019 1/14/2019 1 1/15/2019 SYSDATE …
How to detect changes to values through a specific order
Given Id | RouteId | Milepoint | RoadCondition -: | :—— | ——–: | :———— 1 | A | 0 | X 2 | A | 1 | X 3 | A | 4 |…
Why is the AVG not returning anything in my Where clause in SQL?
The question ask, “List the customer name and phone number for customers whose credit limit is less than the average credit limit. (Customers table)” So far I have …
SQL round percent up to nearest .1
I have a columns of percentages and i want them to always round up to the nearest .1 for example .005 –> .1 .11 –> .2 .3256 –>.4 .6797 –>.7 I am trying ceiling and floor, but they …
Syntax Error when using multiple parameter substitutions in a MYSQL Query
I need to Update MYSQL data using JS after I receive an AJAX Post request I made a variable for the MYSQL Update Query and I’m passing in the field to be updated, new value, row to be updated as an …
Is there a very efficient way to delete from a SQLite table records not in another SQLite table?
I have two tables: Phrase and PhraseSource. Both have an identical structure but it’s possible that PhraseSource might have less rows sometimes when I download data into it. I don’t want to change …
Relational Operators Issue With Null
I am having issues with the below select statement not picking up the data when I insert a relational operator. SELECT C.FIRST_NAME, C.LAST_NAME, B.COMPANY,A.ITEMNO, A.REV, A.DESCRIP FROM ARINVT A …
MySQL INSERT inserting BIT to 1 instead of 0
I have the following query which should insert a 0 but instead inserts 1. It is executed with prepared statements in PHP: All inserts are performed fine, except a 1 is inserted in column6 instead of a 0. Column 6 has the datatype BIT. The query works fine, however, when executing directly in the phpmyadmin &#…
SQL restart number sequence each year
I’m Working to create a simple repair log serial number. I would like to create a unique code for each repair but I don’t want the numbers continuing on forever, I would like to use Zone(department), …