Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2006, 11:24 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help needed, inner join?

Hei!

I have to tables; tblProdukt and tblBestilling. TblProdukt has cell
p1, p2 and p3. TblBestilling has cell b1, b2, b3 and ProduktName.

How can I have two tables held open at the same time and what would the query/VB-script be?

SELECT * from tblProdukt AND tblBestilling WHERE tblBestilling.ProduktName = session("ProduktName"),

And here comes (in words) my query;

AND
tblProdukt.p1 = tblBestilling.b1
AND
is tblProdukt.p2 <> tblBestilling.b2
AND
is tblProdukt.p3 = tblBestilling.b3

The result of the query is then to be %= on a page when some update-button is moused on!

Do While ObjRs. not EOF
<%=ProduktName%>
Loop

Thank you for reading and any answer you maight have.

Med vennlig hilsen

grstad

__________________
Internet has become favorable with that tool...thank you Tim Berners-Lee!
 
Old April 3rd, 2006, 02:55 AM
Authorized User
 
Join Date: Mar 2006
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SELECT * FROM tblProdukt AS P, tblBestilling AS T WHERE T.ProduktName = session("ProduktName") AND P.p1 = T.b1
AND P.p2 <> T.b2 AND P.p3 = T.b3

 
Old April 12th, 2006, 07:18 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

... this gives the error; expeted end


Set objCommand = Server.createObject ("ADODB.Command")

objCommand.ActiveConnection = kobling

objCommand.CommandText = "SELECT * FrOM Produkt AS P, Bestilling AS B " & "WHERE (P.ProduktName <> session("navn") & AND P.ProduktSnekker = B.PartnerSnekker & AND P.ProduktKjonn = B.PartnerKjonn & AND P.ProduktMale = B.PartnerMale)"

objCommand.CommandType = adCmdText

set ObjRs1 = objCommand.Execute
Set objCommand = Nothing

While not ObjRs1.EOF
    response.Write ObjRs1("ProduktNavn") & "<br>"
    ObjRs1.MoveNext
Wend
ObjRs1.Close
Set ObjRs1 = Nothing


... I do need help with the ' and the & and the "'s

Med vennlig hilsen
grstad






Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm new to join oneilsteven BOOK: ASP.NET Website Programming Problem-Design-Solution 0 February 9th, 2008 06:07 PM
Help needed with JOIN Query icecrew SQL Server 2000 3 October 16th, 2006 11:59 AM
INNER JOIN msmagied Classic ASP Databases 3 August 29th, 2004 12:28 PM
Oracle 8i inner join and left join problem puteri_84 Oracle 2 August 19th, 2004 07:14 AM
INNER JOIN?? apek PHP How-To 6 January 18th, 2004 03:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.