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 |
ryan.cook
Starting Member
2 Posts |
Posted - 2013-06-17 : 09:38:39
|
Hey, all;I'm a bit new to SQL, but it's frequently used where I work. I've been delving a bit deeper into queries and ran into trouble with one.What I'd like to do is:-Find all rows in a table that have a specific value in a specific column.-When a row is found, use the data from a different column to search another tableI apologize if that's somewhat vague. In the end, the goal is to search through a table, stop when a condition is met, then search another table with a specific column's data.Thanks in advance!Ryan |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-17 : 09:44:25
|
it will like thisSELECT t2.*FROM SecondTable t2INNER JOIN FirstTable t1ON t1.col2 = t2.col2WHERE t1.SearchColumn = 'your value' ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
ryan.cook
Starting Member
2 Posts |
Posted - 2013-06-17 : 10:06:13
|
Woo! Thank you, Visakh! I'll start fiddling around with that now :) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-17 : 10:06:52
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|