SELECT (CASE WHEN WEEKDAY(NOW()) > 3 THEN
WEEK(NOW(),1)
ELSE
WEEK(NOW()) END)
AS result;
More Related Contents:
- Complex Count in MySQL
- Using column alias in WHERE clause of MySQL query produces an error
- Getting “Lock wait timeout exceeded; try restarting transaction” even though I’m not using a transaction
- Cannot delete or update a parent row: a foreign key constraint fails
- Using union and order by clause in mysql
- Using an Alias in SQL Calculations
- How do I select an entire row which has the largest ID in the table?
- MySQL/MariaDB – order by inside subquery
- Can MySQL replace multiple characters?
- OUTPUT Clause in MySQL
- Search all columns of a table using a single where condition with single keyword in mysql
- Using ORDER BY and GROUP BY together
- Sorting by date & time in descending order?
- Case statement in MySQL
- MySQL Pivot Table Column Data as Rows
- updating columns with a sequence number mysql
- MySQL, Concatenate two columns
- Select a column with a keyword name
- MySQL: Inner join vs Where [duplicate]
- ERROR 1148: The used command is not allowed with this MySQL version
- Selecting from two tables with inner join and limit [duplicate]
- Use Composite Primary Key as Foreign Key
- How to select data where a field has a min value in MySQL?
- How to SELECT by MAX(date)?
- get a recursive parent list
- SQL (MySQL) vs NoSQL (CouchDB) [closed]
- DELETE FROM `table` AS `alias` … WHERE `alias`.`column` … why syntax error?
- MySQL update statement to store ranking positions
- How to convert a varchar column type to date type without losing the dates
- MySQL Multiple Joins in one query?