Removing Redundant Rows?

Jun 13, 2007

Hi All

Can anyone help me with this problem?

I have an 11 million row table that lists relationships between pairs of people. There are several columns, but the relevant ones for my problem are

personA, personB, a-b_strength, b-a_strength.

because of the size of the table i'm having all sorts of problems, and i could actually cut out half of the rows, because for every row listing eg

dave, steve, 4, 5

there's another row listing the same information, but flipped round, ie

steve, dave, 5, 4

I'm sure there must be an efficient way to delete, using a query or otherwise, one of each of these pairs (it doesn't matter which). I have another column (id) that simply has a unique number for every row, ie 1,2,3->11 million, so i was thinking of something like

delete
from table t1
where exists
(select *
from table t2
where t1.personA = t2.personB
and t1.personB = t2.personA
and t1.id < t2.id)

So, this should delete every row that has a mirror version earlier in the list.(i think)

What i'm worried about though, is performance: is this going to make a new temporary table for the nested select for each new row in the outer statement? I already created a table that listed the count of friends for each unique person with a make table query, and that took 12 hours to complete. I don't mind another 12 hour query, but not a 144 hour query!

Any advice welcome - thanks! (Sorry for the longwinded post)

View Replies


ADVERTISEMENT

Removing Rows From A Query Based On Date?

May 11, 2015

I have a query that produces a set of rows that contain product IDs and dates (sent). What I want to do is filter out rows that share IDs with another row such that I keep only one row which has the most recent date. As an example my query might contain the following two rows:

DATE ID
01/01/2015 1
02/01/2015 1

What I want to do is filter my table and under the condition that ID #1 appears more than once only keep the row with the most recent date.

I'm unsure what the easiest way to do this would be (or how to do it at all).

View 2 Replies View Related

Tables :: Excel Sheet - Removing Rows In Import?

Sep 19, 2013

I have an excel sheet that I want to import, it has 3 rows at the top which are titles that I don't want. Can I miss these rows out using the standard import function or do I need to write a custom VBscript ?

View 3 Replies View Related

Redundant Entry

Sep 14, 2004

Each pay period, I must enter data for each employee that worked an extra shift. The table is simple:

Name
Period Starting
Period Ending
Number of Extra Shifts Worked


Is there a way to bulid a form that will keep the dates I type in the period starting and ending fields until I change them?

To clarify, I have 17 employees who worked extra shifts, and I don't want to have to type in the Period starting and ending dates for EVERY record. Thanks in advance for any help. I really appreciate it.

KellyJo

View 2 Replies View Related

Redundant Data Issue..

Jun 30, 2006

I wasn't sure where to post this, so here goes:

Very basically, I have two related tables that I'm working with.

TABLE #1:
tbl_MAIN

FIELDS:
REC_ID (Autonumber) Primary Key [PK]
EMP_NAME
EMP_ADDRESS
DEPT_ID (Foreigh Key [FK] from the tbl_DEPT table...)
ETC...

TABLE #2:
tbl_DEPARTMENTS

FIELDS:
REC_ID (Autonumber) Primary Key [PK]
DEPT_NAME(Text)
ECT...

Now, I'd like to create a form that can enter information on the employee, including the department that they're a part of. I'd like to avoid having duplicate departments in tbl_DEPARTMENTS, but I want new department entries to be created if an employee from a new department is entered into the form. I'd like employees from a previously existing department to get associated with the department entry already in tbl_DEPARTMENTS. Is this possible? What's the best way to do this? I've tried every way I can think of, but I can't get this to work.

Thanks for any advice you can give me.

- Corey

View 2 Replies View Related

Redundant Foreign Keys?

Jul 8, 2005

More on the lot materials management program.

I have a series of related table:

Builder
Subdivision
Lot Number
Lot Option
Lot Materials Details

The [Lot Materials Details] table is populated by appending data from the [House Type Details] table tree as follows:

Builder
House Type
Elevation
Options Per Elevation
House Type Materials Details

The filtered Option Table in both branches determine which [House Type Materials Details] records get appended to the [Lot Materials Details] table.

The question is:
Is there any advantage, other than simpler queries later on, to adding the primary key from the [House Type Materials Details] table to the [Lot Materials Details] table.

It’s redundant because the [Lot Options Table] contains the [Options Per Elevation] primary key.

Any thoughts?

View 2 Replies View Related

Eliminating Redundant Records

May 21, 2007

Dear All,

I have a table with several fields.

Concentrating only on few fields I'd like to sort out redundant information (unnecessary records).

(It is similar to using Ecxel: Data>Filter>Advanced filter>Unique records only)

So, I'd like to ask for your help how can I reduce my table to unique records.

thx

Csaba

View 5 Replies View Related

Merging Redundant Columns

May 13, 2013

I'm doing up a database of hazardous chemicals, based on publicly available information from various agencies. Each chemical has a name and a number, and has different hazards associated to it. The hazards are grouped into classes, and for each class the hazard is further broken down into categories. Hence for an explosive hazard (the class) I could have categories 1, 2 and 3 based on severity. For each iteration of the hazard class and category (for example explosive hazard category 1), there is a non-unique hazard statement. Another complication is that there is a qualitative element in the classification system, and hence agencies from different countries could classify the same chemical differently. This should be captured into the database as well. Thus for every chemical, I will have to enter the Japanese classification, the EU classification, etc.

I've managed to set up what I think is a correct relationship, based on my understanding of databases. However when I generate the report, fields such as the chemical name and ID are repeated for each hazard. I would like to merge these redundant entries, so the chemical name, I.D., and any other repeated fields appear only once. In essence, I'm trying to make it such that there is only one entry for each chemical+I.D/country, with multiple hazard subentries, rather than having multiple, seemingly duplicate entries.

View 3 Replies View Related

Data Base Creation, (Redundant Value Entry)

Jan 2, 2007

Hello,

I am using the access program to create a mailer. The fields are really basic... Name and address....

Many of the fields are going to be identical. City, state, zip code for instance.

The way we had it set up on our first try was to create the data base with all of the fields empty and to input everything over and over. I imagine there has to be a way to set it up so you only have to enter "San Diego" or "CA" once and then simply do manual entry of the names and street address.

Any help getting me started would be well eppreciated.

Thanks

View 1 Replies View Related

Eliminating Keypunching Errors Through Redundant Data Entry?

Oct 15, 2007

I work with an Access database with about 20 tables that requires considerable manual data entry. Although it is time consuming, the bigger problem is the keypunching errors that inevitably occur. A colleague of mine said that some databases can be set up so that two (or more) individuals can enter the same data into the database (basically creating two separate, temporary databases). At the conclusion of this double data entry, the two databases can be compared to see where they differ so that corrections can be made...the logic being that it's extremely unlikely two people entering the same data independently will make the same keypunching error in the same field.

Just wondering if Access has this capability, or if a reasonable facsimile of this approach exists.

Thanks!

View 2 Replies View Related

Modules & VBA :: Scheduling System That Automates Some Redundant Tasks - Expanding Subforms?

Jul 28, 2014

I'm working on a scheduling system for my fathers company that automates some redundant tasks. Most importantly the system manages the order of processes on different parts (ie, part "tubes" may be cut, then drilled, then welded, then shipped).

I'm trying to create a form that allows for the editing and viewing of all the parts and the processes for each part for a specific work Order. Ideally the information that applies to all the parts (Work order Number, due date etc) would appear at the top of the form with all of the processes to appear beneath (Separated into groups - all the parts to be welded shown together). My problem with using sub forms for this was that I need all the records to be shown without scrolling. Is there a way to dynamically change the size of each Subform to match the required size, or is there a better feature to use?

View 7 Replies View Related

Compare Several Hundred Rows Against Other Rows

Nov 21, 2005

Not sure if what I want to do is possible, or at least possible the way things are set up.

I have a massive table - c. 6 million rows. It contains data along these lines:

Plan#, Item, Price, Description, Colour, Value, Location, etc.

The primary key would be Plan# + Item. Each Plan# has approximately 1,000 Items, and there is only 1 Item per Plan#. There are only a limited number of Items (c. 1500) and all or only some Items might be assigned to the Plan#. All items under each unique ID# belong together, sort of in a set. So this huge table has approx. 6,000 unique sets (based on Plan#).

To add to the confusion, Item A under Plan#1 may have different information (Price, Description, Colour, etc.) from Item A under Plan#2. I know this isn't a great way to set up data but this is what I have to work with.

Over the years it's possible that the exact same combination of Items with identical values might have been set up for multiple Plan#s. What I need to do is find any Plan#s which have the exact same combination of Item, Price, Description, etc. So if Plan#R has 200 rows and Plan#S has 201 rows, it automatically doesn't match. If Plan#R has 200 rows and so does Plan#T, all information in each record must match between the two Plan#s (with the exception obviously of Plan#).

I don't think this is possible, and if it is I am sure it's not going to be easy. So far the best I can do is to come up with finding duplicates on Item, Price, Description, etc. but that's only one record at a time and doesn't tell me if the two Plan#s match.

Any help or suggestions would be much appreciated.

Thanks!!!

View 3 Replies View Related

Removing MDW Protection?

Jun 28, 2005

I'm not good with access at all, i'm basically after removing all workgroup protection from a database file. I have full access to the file, admin passwords etc, i'm just having serious difficulty trying to find a tutorial or any information regarding how it can be removed!

View 2 Replies View Related

Removing 3 Numbers

Aug 18, 2005

I am looking to create a make table query to eliminate some portions of numbers from a field.

i have 23899999999

I need to parse 899999999 into a new field.
Is there a formular for that. Do I use a LEN formula.

View 2 Replies View Related

Removing A Field

Jan 25, 2006

I use the template service call management . In the work order section there is a field called Entered By . I would like to remove it as I do not need it and if you do not enter it the work order will not complete . Is there a way to remove it or make it so you do not have to enter anything there >> I have tryed to remove it but somehow it is connected to some thing else and I get error

THXS for Help

Steve

View 8 Replies View Related

Help Removing Characters

Feb 21, 2007

Hello,

I am totally new at this database stuff. I have been searching the archives for a couple hours and confused on how to accomplish what I need to do. I saw references to using a module but I have not used that feature yet.

I am using Access 2003. I need to remove/delete " - " space dash space, "-" and "&" from a string in one field (DGName). I'm trying to do this with a make table query

DGName
P1000
P1000 - SMLS
P1000-CA (not a type error)
UD000 - C&B
V-NET

and I want it to come out like this

DGName
P1000
P1000SMLS
P1000CA
UD000CB
V-NET

Thanks
Sean

View 2 Replies View Related

Removing A @ From The End Of A Field

Mar 15, 2007

Hi there I am extracting user names from e-mails in an access database.

I built the following command to do it

Left([E-Mails by Source - Test]![E-Mail],InStrRev([E-Mails by Source - Test]![E-Mail],"@"))

where [E-Mail] is the e-mail address.

It works great. But I still get the @ and the end of the name.

Any idea how I can get rid of it (other than using find and replace)?

Thanks for your help.

View 1 Replies View Related

Removing The First Character Using VBA

Sep 20, 2006

I posted an earlier question about an Access query export to Excel putting leading apostophe (') before all data.
To remove them I thought I would use Find/Replace but the Apostophe is not recognised!

Is there a way (programmatically) to remove the first character of each data entry in each cell in a column?

thanks in advance

nel

View 4 Replies View Related

Removing Prompts

Nov 1, 2006

Can anyone please help me, I currently have a series of queries that are called by a macro, these create a number of tables. But when each query runs it provide a prompt stating what it is doing, my question is can these be stopped so that the queries run without a user being present.

Thanks

View 3 Replies View Related

Removing Duplicate

Nov 20, 2007

I have a table that has mutliple records for the same person. I know how to create a query to remove duplicates but i don't know how to create a table to remove duplicates but keep the most recent record. Is this possible?


ie
client status date
123 A 1/1/07
123 C 2/5/06
123 A 9/3/07


results

client status date
123 A 9/3/07

View 3 Replies View Related

Removing A Record

Jan 10, 2005

When I ve gone in and deleted a record from my table (new table just testing it) ie. enter number 1 deleted it and than gone in and entered (on the form) another enter the (auto number) goes to 2.
I want to know how to i get it to go back to the previous number.

thanks

View 1 Replies View Related

Removing Dulicates

Apr 23, 2008

I have two tables: “tmptable” and “CC_CODES”

Both tables contain the same data; however the “tmptable” contains updated data. How can I compare both tables and remove all the duplicate in the tmptable, leaving only the updated data.

I will be comparing the fields “IsMandatory” from both tables

View 1 Replies View Related

Removing Separators

May 12, 2006

I have a field that contains serial numbers. The serial numbers are entered in difference formats. Some will have dashes, spacing and periods separating the numbers (example: 06-65432 or 06 65432 or 06.65432). I am trying to create a search field for this and the different formats makes it difficult. Is there a way to remove all separators so that all parts of the serial number are together?

View 2 Replies View Related

Archive, Removing Records

Jul 5, 2005

hi

i have a form with various fields, on this form i have an archive button that places certain fields in an archive form. however this does not remove the information from the main form. pls see attached

any ideas, as some will know i'm a newbie

View 1 Replies View Related

Removing Duplicates From A Query

Aug 14, 2006

I am running a query to return records from a table. I want to eliminate records from the query if the values contained in one field are duplicated. I have tried using the DISTINCT keyword but it only works if the entire record is unique or if I was retieving just one field

Any suggestions appreciated

View 1 Replies View Related

Removing Previous Data

Nov 5, 2006

can someone help:

in a form I've created showing products bought, when I add a new new order it still keeps the previous order's data, how can I prevent that from happening?

cheers

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved