By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Proper way to deal with serial numbers of inventory stock catalog

P: 23
The end goal is to have data input (various serial numbers) along with data output (various serial numbers) handled such that I can continually update the database with the "remaining data" (any nonidentical serial numbers). If my data tables are such that:

Expand|Select|Wrap|Line Numbers
  1. InputData
  2. serial1
  3. serial2
  4. serial3
  5. serial4
  6. serial5 

Expand|Select|Wrap|Line Numbers
  1. OutputData
  2. serial1
  3. serial3
I would like to be able to:
- compare data points in each table
- recognize identical data points
- if datapoints are identical, delete said records... creating a remaining list of only the serial numbers in stock

I have two general questions that pertain to the best method to do so...

Firstly, handling the data:
I have two thoughts... create a count of each of the input and output data (assuming they are in separate tables)... each count will be 1 because the serial numbers are unique. I can then theoretically identify identical records in each table, subtract the count (will always subtract to 0 if there are identical serial numbers) and then have code that deletes the record if the combinedcount=0.

Conversely, I can theoretically search each table for identical text... if there are identical text records, delete record.

^This questions pertain mainly to: is it easier to deal with the data identification and deletion through numbers (a count of 0) or simply through data recognition (text)

i have two databases I was messing around with...
Database1: input and output are two separate tables
Database2: input and output data are in the same table and thus represent different fields in the table.

Does anybody have experience/an opinion on which database would best set me up for success when trying to delete identical records (should I have two separate tables that are compared or can i compare data in the same table and delete identical records between the two fields)??

Thank you!
May 9 '17 #1
Share this Question
Share on Google+
4 Replies

P: 23
Apologies, I was stuck in the line of thinking of my previous problem that I was viewing incorrectly.

Due to the fact that each record is guaranteed to be unique upon entry (no record in the same table will have the same values because serial numbers are unique), this is simply an unmatched union query between two separate tables.

Thus, the answers to my above questions are:
1) use unmatched union query (query wizard helped for this)
2) The unmatched union query requires comparison of two separate tables and therefore my input, output records had to be separate tables!!
May 9 '17 #2

Expert Mod 15k+
P: 31,411
Hi Tyler.

I've reset the Best Answer as this is generally not set to any post by the OP (Original Poster - in this case you). Nevertheless, providing an answer yourself is always appreciated and respected.

Another tip :
We generally require all questions be kept in separate threads. Thus, this would typically have been spread across two as it contains two questions. You'll see, if you think about it, why this makes good sense when dealing with the volumes of questions we do.

Please don't see either comment as criticism. You're new here and learning the ropes. Doing pretty well so far, but will certainly improve once some of these extra points are taken on board.
May 9 '17 #3

P: 23
Thats fair and no worries all constructive! I just figured marking it as best answer would remove it from being an 'unanswered question'
May 16 '17 #4

Expert Mod 15k+
P: 31,411
That makes perfect sense and I also find it easy to believe. Just to reiterate, this is just to help you to understand how things work here. All good so far :-)
May 17 '17 #5

Post your reply

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