473,952 Members | 3,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Common data

balabaster
797 Recognized Expert Contributor
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 961

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

Similar topics

3
6810
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 by Norman Diamond the bug may result in loss of data when saving files with the standard common dialog control. Norman Diamond describes the problem as follows: ---------- In VB6 SP6, VB6 SP5, and possibly others, the common dialog box...
8
3379
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 city_id 1 john newyork null
1
1992
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 doing wrong? thanks, mike
0
1862
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 Appid:*LOCAL.WWS.01AFC9110326 data protection sqlpALR_OpenExtent Probe:5 Database:XTRADE RenameArray: add unarchived log 1227. 2004-01-14-09.07.52.947000 Instance:WWS Node:000 PID:3512(db2syscs.exe) TID:1116 Appid:*LOCAL.WWS.01AFC9110326
3
1771
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 contains the following: Imports System Namespace MySpace Public Class dataClass
0
932
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 system.data.common before i do anything, however in visual studio 2005, the closest reference I can find is just system.data. Will this include the .common features? Cheers for any help!
1
1796
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 are using, and then either store it directly in a database we have designated for this purpose or if they are using the tool off-line and off-network, it will store the data in a IsolatedStorage file, and then when the user is connected to the...
7
12788
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 solution. Actually I am so confused to find an elegant way to store such common data for the two. If you have any idea about that, please let me know. Thanks alot! .viettrung.
6
11512
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
10175
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9999
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11608
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11380
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10706
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6239
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6363
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4969
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.