Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 12 lis 2014 · Of course you can do it in MySQL query. And you can do it in WHERE like this: SELECT * FROM your_table WHERE IF (CURDATE() > start_date, 1, 0) = 1; this query will select only rows that are 'higher' then column 'start_date' (start_date must be type DATE)

  2. Definition and Usage. The IF () function returns a value if a condition is TRUE, or another value if a condition is FALSE. Syntax. IF (condition, value_if_true, value_if_false) Parameter Values. Technical Details. More Examples. Example. Return 5 if the condition is TRUE, or 10 if the condition is FALSE: SELECT IF(500<1000, 5, 10);

  3. www.mysqltutorial.org › mysql-stored-procedure › mysql-if-statementMySQL IF Statement - MySQL Tutorial

    Summary: in this tutorial, you will learn how to use MySQL IF statement to execute a block of SQL code based on a specified condition. Note that MySQL has an IF() function that differs from the IF statement described in this tutorial.

  4. 1 lut 2013 · Here is an example that uses date functions. The following query selects all rows with a date_col value from within the last 30 days: mysql> SELECT something FROM tbl_name-> WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= date_col; The query also selects rows with dates that lie in the future.

  5. www.mysqltutorial.org › mysql-control-flow-functions › mysql-if-functionMySQL IF Function - MySQL Tutorial

    MySQL IF function Examples. Let’s practice with several examples to see how the MySQL IF function works. A simple IF function example. You can use the IF function directly in the SELECT statement without the FROM and other clauses as follows: SELECT IF (1 = 2, 'true', 'false'); -- false Code language: SQL (Structured Query Language) (sql) Try ...

  6. www.mysqltutor.com › mysql-if-functionMySQL IF function

    The MySQL IF function is a control flow function that allows you to perform conditional logic within a query. It is commonly used in SELECT statements to return different values based on a specified condition. Syntax. The syntax for the MySQL IF function is as follows: IF(condition, value_if_true, value_if_false)

  7. This page shows you the most commonly used MySQL Date functions that allow you to manipulate date and time data effectively. Section 1. Getting the current Date & Time. This section explains the functions that allow you to retrieve the current date, time, or both.

  1. Ludzie szukają również