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 |
|
scantoria
Starting Member
15 Posts |
Posted - 2009-11-20 : 17:21:42
|
| I have a record and attachment tables. I need to write a query that will let me know if there is a file attached to a record. would be nice if I can get the result in boolean data type.Stephen Cantoriascantoria@msn.com |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-11-20 : 17:46:59
|
| [code]SELECT Case WHEN Exists(SELECT * FROM t1 JOIN j2 on t1.id = t2.id) THEN 1 ELSE 0 END[/code] |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
scantoria
Starting Member
15 Posts |
Posted - 2009-11-20 : 18:36:35
|
quote: Originally posted by russell
SELECT Case WHEN Exists(SELECT * FROM t1 JOIN j2 on t1.id = t2.id) THEN 1 ELSE 0 END
Thank you so much. This query did the trick.Stephen Cantoriascantoria@msn.com |
 |
|
|
|
|
|