Reply to Re: How to make correct join

Your name:

Reply:


Posted by Jack Vamvas on 04/04/06 18:27

Post your current SELECT statement.
Usually , you would use an INNER JOIN for your requiremnts , i.e An inner
join returns all rows that result in a match .

Are you currently using a LEFT JOIN?


--
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm


<jannoergaard@hotmail.com> wrote in message
news:1144159750.922225.272910@v46g2000cwv.googlegroups.com...
> Hi
> I have to tables one called GROUPS and one called ACCOUNT
>
> In table Group I have the follwing fields
> Groupid, AccountFrom, AccountTo
>
> In table Account I have
> AccountNo, Name etc.
>
> Records in Groups:
> P1, 1001, 1002
> P1, 1005, 1007
> P1, 1010, 1010
> P1, 1007, 1012
>
> Now I want to have the corresponding AccountNo from ACCOUNT (from range
> AccountFrom..AccountTo), that is the following result:
> 1001
> 1002
> 1005
> 1006
> 1007
> 1008
> 1009
> 1010
> 1011
> 1012
>
> If f.x. 1008 doesn't exist in ACCOUNT this should not be listed. The
> result will be used in another view.
> My problem is that I also get every other record from table ACCOUNT.
>
> Do anyone out there have a solution on my problem ?
> BR/Jan
>

[Back to original 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

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