You are here: Re: Help with Select and IN « MsSQL Server « IT news, forums, messages
Re: Help with Select and IN

Posted by Roy Harvey on 03/19/07 14:02

I posted this in microsoft.public.sqlserver.programming in response to
the copy you posted there. In the future if you must post to multiple
groups, include all of them in the same copy of the message.

There are a number of ways to do this, but most become long and
complicated. This may be the simplest.

SELECT Name
FROM tbl_J as A
WHERE EXISTS
(SELECT * FROM tbl_CJ as B
WHERE B.CJ_ID = 23515
AND A.J_ID IN
(B.J1, B.J2, B.J3,
B.J4, B.J5, B.J6))
ORDER BY Name

Roy Harvey
Beacon Falls, CT

On 19 Mar 2007 05:39:37 -0700, "Giorgio" <FJMartinho@googlemail.com>
wrote:

>Can someone tell me options to do this statment because this one does
>not work!
>
>SELECT Name FROM tbl_J
>WHERE J_ID IN
>(SELECT J1, J2, J3, J4, J5, J6
>FROM tbl_CJ
>WHERE CJ_ID =23515) ORDER BY Name

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация