473,386 Members | 1,830 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,386 software developers and data experts.

Common data

balabaster
797 Expert 512MB
How would I write a query to give me back the common piece of data that exists across multiple fields...

I'll give a basic example...I've got a bunch of fields that were returned as the result of a regular expression - for instance, a bunch of postal codes. Obviously the commonality is the regular expression... they all matched.

So how do I get the matching data itself from across these fields...

T3A5N1
T3A5N2
T3A5N3
T3A5N4
T3A4N1

The regular expression was actually "(?<=^|\W)(?i:[A-Z]\d[A-Z]\s*\d[A-Z]\d)(?=\W|$)".
As we can see, any validly formatted postal code would have been extracted from the string.

Given that we have a list of all valid postal codes from our recordset, I now need to know any commonality between them on a more granular level than my expression handles.

For instance, as a human, I can say that "T3A_N_" is the pattern of common data from the fields returned.

How would I express this in T-SQL? Is it possible to express this as a T-SQL query? Or would I need to send the dataset to the CLR and do some comparison there?
Jul 8 '08 #1
0 942

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

Similar topics

3
by: S.W. Rasmussen | last post by:
With the risk of being accused of multi-posting I would like to draw the attention to a serious visual basic/windows issue discussed in the microsoft.public.vb.bugs newsgroup. As pointed out below...
8
by: Jan van Veldhuizen | last post by:
The UPDATE table FROM syntax is not supported by Oracle. I am looking for a syntax that is understood by both Oracle and SqlServer. Example: Table1: id name city ...
1
by: mike w. | last post by:
I have the following code in my asp project. In Test.lpk i added MS Common Dialoag but i always get an error "Object required: "Common Dialog1" so CommonDialog1 isn't being created. What am i...
0
by: Klemens | last post by:
what do entry's like this in db2diag.log indicate? ------------------------------------------- 2004-01-14-09.07.52.650000 Instance:WWS Node:000 PID:3512(db2syscs.exe) TID:1116 ...
3
by: Pete via DotNetMonster.com | last post by:
Hi, I've created a class that contains a common function. When I try to invoke the function or method, I get the error: BC30451: Name 'dataClass' is not declared. The class file dataClass.vb...
0
markmcgookin
by: markmcgookin | last post by:
Hi Folks, Just wondering, I am using a book about Visual Basic .Net Compact framework, but am working on a project using visual studio 2005, and in my book it tells me to import a reference to...
1
by: SteveM | last post by:
I am writing a ToolUsage tracker which we will be accessing from each of our custom written tools. It will basically capture various pieces of information about the user, and the application they...
7
by: viettrung | last post by:
Hi, I have two classes that share a common data list (specifically, a std::vector). This data list should be accessed by the two classes only, so I think using a global variable is not a good...
6
Markus
by: Markus | last post by:
Things to discuss: Headers What are they? What does PHP have to do with headers? Why can they only be sent before any output? Common causes
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.