I am trying to pupulate 1 table with results from 2 select querys but from the same table. It is not working, one pupulates the other one shows only one result.. Is it posible to do this in one select …
Tag: sql
A form can return varying number of values, trying to use the returned values in doctrine query
I have saved a bunch of parsed messages in a db, and I want to be able to pull out results depending on user input. I would like to sort by 1-4 values (more options later on), username, id, email or …
How can I find the mix of 2 fields with a like in SQL/Laravel?
I have a table posts which contains posts (id field, candidate_id field and text field). I also have a candidate table (id, first_name, last_name). Now, I want to implement a method that would let me put some text, for example: “Mike Doe” and it would give me all the posts that contain “Mike Doe” or that the candidate first_name +
PHP script taking too long. Need someone to take a look at my code to optimize it
I have a script that fetches data from a remote restful API and saves it to the local database. I get the reponse from the server in chunks of 2000 so i have to check if a nextRecordsUrl exists so i …
How to use multiple selects in same query without messing everything
So, i have this query which outputs this table then i have this other query which outputs this: All i want to do is place the two columns side by side without bugs. tried this but it returned this: Here is the ER diagram: Answer Ok, Is hard to follow up the logic with the above information, so I can’t
MySQL SUM of multiple rows from multiple table
I am trying to get the sum of multiple rows from 2 different tables, but somehow the result returns multiple rows. I need to get the SUM of quotation_item_amount (group by quotation_id) and invoice_item_amount (group by invoice_id) and if I query unpaid quotation, I need to get WHERE SUM(invoice) < SUM(quotation) So here’s my sample table The result that I
Using ORDER BY and FIELD function to get single value to each custom list
I have a table named orders having 2 columns orderNumber & status as follow : orderNumber | status —————————- 10100 | Shipped | 10101 | Resolved | 10102 …
How to combine search text and checkboxes using sql bootstrap php
What I have so far: I’m working on a database based website. So far, I have a search-text-form with bootstrap and a submit button in index.php. In search.php, I get an output according to the word I …
How can I update a table data (td) with respect to another table data of a different column
I have a table I would like to display data based on other column data on the same table. Below is my code as I am now stuck on what to do. My query I would also like to not hardcode the SQL like this category_name=’Pinnacle’… Below is UI you can see that BG and Pinnacle had the same values
Left join on two tables and want to get results from a specific date
I have written a MySQL query to do left join on two tables . My result query is showing the result I wanted . I just want to know how to further make it limited to specific dates . The column which I want to sort is user_registered and is showing date in this format 2020-12-17 06:06:05. So how to