473,471 Members | 4,650 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to delete the remaining records from a specified date(ex:lasstdate)

1 New Member
hi everybody............
i have problem in my coding section...........
how to delete the remaining records from a specified date(ex:last six date records i want to for a perticular user and remaining all other records which is less date from six last dated) from mysql database???

plz help me .........
thanks for your cooperation
Nov 24 '07 #1
1 1126
coffear
20 New Member
DELETE FROM table_name WHERE date < (SELECT CURDATE()-6) AND user_id = 3

I have not checked the SQL but this was just to give you the gist. This code would delete all records from table_name that were older than 6 days old and belonged too user with the id 3.
Nov 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: ms | last post by:
Access 2000: I am trying to delete duplicate records imported to a staging table leaving one of the duplicates to be imported into the live table. A unique record is based on a composite key of 3...
4
by: KT | last post by:
Is there any one click solution that would do the trick? I would like to create a button, so the person who maintains the database can perform clean up work to delete duplicate records which...
3
by: jeff | last post by:
Dear all, i want to delete all records in a table (ms access database) now my method used is not good, i have to loop all record in the datatable and delete it one by one. however, i can't :
1
by: nico3334 | last post by:
I am trying to delete all records from all tables in Access through VB coding. I would like to do it dynamically in case new tables are added. Here is what I have so far: I have a form with a...
5
kcdoell
by: kcdoell | last post by:
Hello: I am trying to write a code that will delete all records found in my DAO recordset Below is the code I have so far: 'Procdure to give the user the ability to delete all records 'for a...
7
by: jedgretzky | last post by:
I am having trouble creating a query that will delete duplicate records. It seems to me that this isn't that hard of a query, but I just can't seem to get it working. What I have is a table that...
6
by: Dilip1983 | last post by:
Hi All, I want to delete duplicate records from a large table. There is one index(INDEX_U1) on 4 columns(col1,col2,col3,col4) which is in unusable state. First of all when i tried to rebuild...
5
WyvsEyeView
by: WyvsEyeView | last post by:
Upon clicking Delete to delete the current record on frmTopics, I want several things to happen: 1) Display a custom message rather than Access's standard "You are about to delete n records" one....
4
by: mark007 | last post by:
I have two tables invoice and so_salesorderdetail1, I want to delete those records from invoice which are not in so_salesorderdetail1. these tables don't have any unique key so I am trying to make...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.