goma smile Posted March 28, 2013 Report Posted March 28, 2013 Sveiki, nez man kaut kā nesanāk, bet kā var ar vaicajumu izdzēst visus ierakstus kas ir vecāki par 3 dienām no ieraksta izveidošanas laika, ja laiks glabājās timestamp formātā Quote
codez Posted March 28, 2013 Report Posted March 28, 2013 DELETE FROM sometable WHERE timestampfield<unix_timestamp()-259200 Quote
goma smile Posted March 28, 2013 Author Report Posted March 28, 2013 Bet šitas "2013-03-28 11:06:36" tak ir timestamp ? Quote
rpr Posted March 28, 2013 Report Posted March 28, 2013 vispār tas ir string, bet tikpat labi db lai būtu pārskatāmāk tavu timestamp pārkonvertē uz string, bet vispār arī atkarīgs kādu db izmanto un kādu klientu. paskaties tabulas struktūrās un viss būs skaidrs. Quote
Kavacky Posted March 28, 2013 Report Posted March 28, 2013 Pēc kā tu zini, ka tas nav TIMESTAMP? Quote
Kavacky Posted March 28, 2013 Report Posted March 28, 2013 New task: +---------------------+---------------------+ | f1 | f2 | +---------------------+---------------------+ | 2013-03-28 13:37:00 | 2013-03-28 13:37:00 | +---------------------+---------------------+ 1 row in set (0.00 sec) Quote
Kemito Posted March 28, 2013 Report Posted March 28, 2013 goma smile, ieteiktu palasīt - http://datubazes.wordpress.com/ Quote
Kavacky Posted March 28, 2013 Report Posted March 28, 2013 Tur tik elementārus jautājumus neapskata, man šķiet. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.