Skip to content

Update user id by looking up two other tables

I have a table/sql issue I don’t know how to solve. I need to update/create a table of user ids with order ids. Therefore I have to get a new user_id, by searching for the email in an old list. With the email adress I need to look up the new user id. So the logic is like: order_id ->

Where clause with multi AND & OR conditions

I got a table agenda in which the admin can make a reservation for him self or for someone else (another user). If the admin make the reservation for him self in agenda.user_id will be stored the id of admin. In case that admin make a reservation for another person (another user) in agenda.user_id will be sto…

Extracting data from only the year

I have data in a table in SQL with dates, but how do I select only those that happen in 2021. (The dates look like 31-oct-2020) in the table. The dates are the actual date variable, not just text. Answer You should avoid storing your dates as text, but rather should use a proper date column. That being said, …

Find sum from 2 tables and write code in php [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 12 months ago. Improve this question This is the query image: This result should appear as follows: This is m…