Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
repstronics
Starting Member
4 Posts |
Posted - 2009-11-07 : 12:47:21
|
| Hi I have the following information on a table Contact | Contsupref | Linkacct | Recid | StateJhon Smith | Supplier | NULL | AI0IT33 | MassE-mail | John@smith.com| AI0IT33 | AIXIT34 | NULLand I want to have a query that has the result of John Smith John@smith.comThe only information I linking the tables is Recid and LinkacctIf you can Help I'll really appreciate it |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-11-07 : 13:01:55
|
Are there more linked records than this about email?If not then you can do the following:select t1.Contact,t2.Contsupreffrom your_table as t1join your_table as t2 on t2.Linkacct = t1.Recid No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
repstronics
Starting Member
4 Posts |
Posted - 2009-11-07 : 13:18:38
|
| Sorry I forgot to mention that also the state has to be Mass |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-11-07 : 13:49:09
|
select t1.Contact,t2.Contsupreffrom your_table as t1join your_table as t2 on t2.Linkacct = t1.Recidwhere t1.State='Mass' No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
repstronics
Starting Member
4 Posts |
Posted - 2009-11-07 : 15:14:13
|
| Vielen Dank!!! |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-11-07 : 15:25:03
|
Es war mir ein Vergnügen!  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|