We should use the following statement to calculate one day ago date time using MySQL:
SELECT NOW() - INTERVAL 1 DAY;
We should use the following statement to calculate one day ago date time using MySQL:
SELECT NOW() - INTERVAL 1 DAY;
The following select query returns next auto increment value:
SELECT AUTO_INCREMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = "db_name" AND TABLE_NAME = "table_name"
UPDATE your_table SET url = REPLACE(url, 'test/1', 'test/2') WHERE url LIKE '%test/1%'
Example usage is like the following:
CREATE TABLE persons( id INT NOT NULL AUTO_INCREMENT, name CHAR(30) NOT NULL, surname CHAR(30) NOT NULL, gender ENUM('male','female','unisex') NOT NULL, PRIMARY KEY (id,gender) ); INSERT INTO persons(name,surname,gender) VALUES('erman','gülhan','male'),('ayşe','dolu','female'),('ali','veli','male'); # this returns gender as string SELECT name,gender FROM persons; # this returns gender as numeric index SELECT name,gender+0 FROM persons;