473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Find Best Match

Hi,
I have 2 tables with same fields like event, venue, date and cost. Table 1 has 5 records and Table 2 has 100 records. How can i match a record from Table 1 with Table 2 to get the exact match record of Table 1 record. Event Venue fields are string datatypes which will not have same records. I need the nearest match .Please help me out. Thanks in advance.
Sep 24 '07 #1
2 1383
Plater
7,872 Expert 4TB
This is really an SQL based question (unless you REALLY want to do it in code).
Perhaps a mod could it move it to the SQL section for you?
Sep 24 '07 #2
bldink
2
Personally, I find that you could do this in either place, app-side or SQL-side. Frankly, with there being only 200 records x 5 records that means the greatest number of scans that would take place would be 5 complete scans over the 200 records to a maximum of 1000 records (still really small).

Also, if done in SQL, or DB side in general, you can minimize this by only selecting those from Table 2 where they meet some criterion from Table 1 like the date and cost. If you are savy enough to create CLR stored procedures, you can do the whole thing in there; utilizing .NET's superior expressions to allow matching of similar strings.

Post Note: If you know that the columns "Date" and "Cost" in T1 and T2 could/will match, then you could "fuzzy" match them DB side if there is only one record returned with that exact date and cost.

Hope this helps...
Sep 24 '07 #3

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

Similar topics

5
by: Daniel Pryde | last post by:
Hi everyone. I was wondering if anyone might be able to help me out here. I'm currently looking to find the quickest way to find a best fit match in a large array. My problem is that I have an...
8
by: Christopher Parent | last post by:
I have perused through the groups and a couple C++ manuals and haven't been able to figure this one out. Maybe I'm staring at it too much. Here's the setup, I have 2 files. One is a library and one...
11
by: Pete | last post by:
Is there any way to change the default search to "Any Part Of Field" instead of whole field? The first thing I ever do when searching for something in a field is change the default setting from...
3
by: skosmicki | last post by:
I need to create an function similar to the "MATCH" function in Excel that evaluates a number within a set of numbers and returns whether there is a match. I have put the example of what I see in...
2
by: Note Myself | last post by:
Today I wanted to solve an problem: I need to find out in the code if the iterator passed is a st::vector<T>::iterator, or std::vector<T>::reverse_iterator. I spent a lot of time tweaking a...
0
by: RiverstoneJebin | last post by:
Hi, I have 2 tables with same fields like event, venue, date and cost. Table 1 has 5 records and Table 2 has 100 records. How can i match a record from Table 1 with Table 2 to get the exact match...
2
by: Sejoro | last post by:
Hello, I am trying to write a program that opens a file; reads through it; outputs the text; then outputs the number of lines, words, and characters. Problem is, every time I try to compile, no...
11
by: ankitmathur | last post by:
Hi, I'm trying to overcome a situation whereby I have to search through 4-5 columns and produce the results with an order by according to the values matched in these columns. Example: My...
3
by: raylopez99 | last post by:
I suspect the answer to this question is that it's impossible, but how do I make the below code work, at the point where it breaks (marked below). See error CS0411 This is the complete code. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.