|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Select statement
I have two database tables. One table contains an entire list of users. The other table contains a partial list of users. I need the entries from the first table which is NOT in the second table. I'm not succesful with the statement that I cooked up:
<%SQLstmt="SELECT * FORM table1 WHERE NOT EXISTS(SELECT * FROM table2 WHERE table2.User=table1.User);" Set rs = conn.Execute(SQLstmt) while not rs.eof Response.write rs.fields("Navn")%><br> <%rs.movenext wend%> I get the error: Microsoft OLE DB Provider for ODBC Drivers error '80040e10' [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2. /Test/fill.asp, line 139 Quite frankly I don't get it Can anybody help? Regards |
|
#2
|
|||
|
|||
|
You spelled FROM as FORM, for one thing.
|
|
#3
|
|||
|
|||
|
Well, that's not the problem
That happened when I cleaned the code up for this forum.I have two database tables. One table contains an entire list of users. The other table contains a partial list of users. I need the entries from the first table which is NOT in the second table. I'm not succesful with the statement that I cooked up: <%SQLstmt="SELECT * FROM table1 WHERE NOT EXISTS(SELECT * FROM table2 WHERE table2.User=table1.User);" Set rs = conn.Execute(SQLstmt) while not rs.eof Response.write rs.fields("Navn")%><br> <%rs.movenext wend%> I get the error: Microsoft OLE DB Provider for ODBC Drivers error '80040e10' [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2. /Test/fill.asp, line 139 Quite frankly I don't get it Can anybody help? Regards |
|
#4
|
|||
|
|||
|
in subquery return the unique ID, i don't think not exists can compare multiple values like that....
exampel Code:
SELECT * FROM table1 WHERE NOT EXISTS (SELECT id FROM table2
WHERE table1.id=table2.id);
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Select statement |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|