Skip to content

Tag: mysql

MySQL SELECT only rows where tbl_col equal to this and that

I am struggling a bit with my SQL query. This is the query i have now, and it works as is, but i want to add some more to it. In the mysql table, there is a column that is named “type”. I want to filter the rows and get the rows with the string “sms” or the string “email”

how to display data on 2 different date ranges

I have the following date data, which is used to display MySQL data parameters and I have the following query: The result I want is that the program will display data from date :$tgaw to date: $tgak Answer You should be using prepared statements here, and also use the MySQL functions to add one month to the u…

How to use join to link values from one table to another

I have two tables. drivers name number email requests id driverassigned …. I want to get everything from drivers table that may or may not be mentioned in requests.driverassigned. I have tried using join but it returns rows that have a match. Here is what I have so far. I am sure there is a common solut…

DATEDIFF vs (w1.date = w2.date +1) difference? MySQL syntax

I was working on a SQL database question using MySQL. The goal is to find all IDs that satisfy today is warmer than yesterday. I’ll show you my original code, which passed 2 out of 3 test cases and then a revised code which satisfies all 3. What is the functional difference between these two? Is it a My…