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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 WHERE in a JOIN

Author  Topic 

Sjenja
Starting Member

2 Posts

Posted - 2011-07-28 : 11:08:02
We have this:

Set RS = Conn.Execute("SELECT DISTINCT Undergrupper.Tekst AS Tekst, Udbud.Undergruppering AS Undergrupperingsnr, Udbud.Undergruppering_direkte_link AS Direkte_link, Undergrupper.Raekkefoelge AS Raekkefoelge FROM Udbud INNER JOIN Undergrupper ON Undergrupper.Id=Udbud.Undergruppering ORDER BY Undergrupper.Raekkefoelge")

But we need to have some kind of WHERE inside it, as we only want it to return rows where Udbud.Undergruppering=2 (or another number). Or maybe it's not a WHERE we should use, but something completely different? How do we do that?

flamblaster
Constraint Violating Yak Guru

384 Posts

Posted - 2011-07-28 : 11:56:47
Set RS = Conn.Execute("SELECT DISTINCT Undergrupper.Tekst AS Tekst, Udbud.Undergruppering AS Undergrupperingsnr, Udbud.Undergruppering_direkte_link AS Direkte_link, Undergrupper.Raekkefoelge AS Raekkefoelge FROM Udbud INNER JOIN Undergrupper ON Undergrupper.Id=Udbud.Undergruppering
WHERE YOURTABLE.YOURCOLUMN=SOMEVALUE ORDER BY Undergrupper.Raekkefoelge")
Go to Top of Page

Sjenja
Starting Member

2 Posts

Posted - 2011-07-28 : 12:09:08
THANK YOU THANK YOU :-)

We had tried doing exactly that, but we must have done something wrong, because it didn't work.. But yours did :-) !

We are very thankful!!
Go to Top of Page

flamblaster
Constraint Violating Yak Guru

384 Posts

Posted - 2011-08-02 : 22:01:34
Welcome! :)
Go to Top of Page
   

- Advertisement -