I have a A table to store the product name, the quantity and input day of goods in stock. In adverse conditions, invoices for the above products will be sent later. I will put the product name and invoice quantity in B table. The problem here is that I want to check the quantity of goods with invoice and without
Tag: sql
Query that only selects unique data
I just can’t make a request that will count only unique records. There is a table: bbs with columns: to_id – to whom from_id – from whom You need, for example, this data: That is, for example, we are 1. And it should count not 5, as it currently thinks, but 3. You need to select 2 columns, only unique
Validation to check no existing overlaps with previous bookings
I need to validate that a booking doesn’t overlap in date and time with an existing booking and return and error if a booking is overlapping an existing booking. This is the code I have right now but it isn’t working, and when I make another booking that overlaps an existing booking, it is still passing through and not returning
PHP SQL Query to get the most common value in the table
I’m trying to have my query count the rows and have it return the most common name in that list, then from that it counts how many times that name appears and outputs the name and the amount of times its there This is the code I’m using: However, it just displays the first username in the table and counts
SQLite3 Update a row based on a select query in another table
Basically I am trying to find a way to update the vehicle’s booking status associated with the client_drivers_license_number after its matched to a variable I will input on my laravel project (123456789 below). I am not sure how I can make an update with values matching from mulitple tables so my best attempt is below so I can explain the
Convert multiple php code conditions to an SQL command
I am working on a php project where I need a dynamic column to be part of the sql query result, I have a trips table where each one might have many travels, the trip status is always calculated dynamically according to the several conditions below: I need to convert the function below to an SQL function so that the
Symfony 5 queryBuilder count data
in one of my queries I am joining three tables to allow me to filter by taking into account these three tables. The problem is when I do a counter of the data from the main table (CV table), like I join the language table (ManyToMany), the categories table and the diploma table (manyToMany), when I do a counter of
Error updating record: Unknown column ‘Jason’ in ‘field list’
Forgive me if this already exists, but I didn’t see anything close enough to my issue to offer any kind of solution or path toward solving. My Query: $sql = “UPDATE users SET FirstName=$fname WHERE id=$id”; $fname does equal Jason. But it should be changing the sql field FirstName to “Jason”. Instead, it is trying to find a field named
Input Field to Laravel save: store datetime when adding just the date
Goal: have two columns (datetime) save an input field that only takes in date I would like the start date to save 11/11/2021 00:00:00 and the end date 11/12/2021 23:59:59 (only the date can be changed) from a text field that a user can only place a date in the text field: snippet of my store function: the code above
How to sort numbers containing current year in prefix
I am having trouble sorting the job numbers in my project. My client requirement is to store the job numbers in the below format:- For example:- The current year is 2021 so the job number will be like this:- When the year changes it should start again from 1 and so on for the next year. For example:- I had