Tradurre una query a livello applicativo
bluland non è online. Ultima attività: 05/08/2008 13.24.23bluland
Inserito il: 23 aprile 2008 17.08
165 messaggi dal 17 apr 2006 Istalla Microsoft Silverlight!
salve,

ho la seguente query

SELECT COUNT(*)FROM dbo.[table1]
WHERE [Complaint NuMber]
NOT IN(
SELECT E.[Complaint Number]
FROM dbo.[table1] E RIGHT JOIN table2 R
ON E.[Complaint Number] = R.[Cust Fault Reference No]
WHERE E.[Complaint Number] IS NOT NULL)

oppure

SELECT COUNT(*)FROM dbo.[table1]
WHERE [Complaint NuMber]
NOT IN(
SELECT [Complaint Number]
FROM dbo.[table1] WHERE [Complaint NuMber]
IN (SELECT [Cust Fault Reference No] FROM table2 ))

a livello applicativo ho due datatable da cui dovrei ricavare lo stesso risultato di questa select..

idee?

saluti



Idee?

saluti

Vincenzo Pesante
System Engineer
Microsoft Most Valuable Professional
Re: Tradurre una query a livello applicativo
Daniele Bochicchio non è online. Ultima attività: 07/08/2008 16.37.53Daniele Bochicchio
Inserito il: 24 aprile 2008 17.56
contributi / Top Poster / Community manager / daniele.aspitalia.com / Blog / 9511 messaggi dal 31 ago 1998 Istalla Microsoft Silverlight!
bluland wrote:
a livello applicativo ho due datatable da cui dovrei ricavare lo stesso risultato di questa select..

cioè vuoi riprodurre il filtro in codice? DataTable ha un metodo Select, ma non so quanto abbia senso fare queste cose lato codice, dopo essersi tirati giù i dati, anzichè farlo direttamente fare al database, che nasce per queste cose.

Daniele Bochicchio

ASP.NET
.NET Framework
LINQ
Silverlight
Re: Tradurre una query a livello applicativo
bluland non è online. Ultima attività: 05/08/2008 13.24.23bluland
Inserito il: 24 giugno 2008 13.29
165 messaggi dal 17 apr 2006 Istalla Microsoft Silverlight!
In effetti la query che ho scritto era solo per dare l'idea, ma in realta' i dati sono presi da file excel.


CIao

Vincenzo Pesante
System Engineer
Re: Tradurre una query a livello applicativo
theproject non è online. Ultima attività: 03/08/2008 9.37.09theproject
Inserito il: 25 giugno 2008 14.11
57 messaggi dal 16 nov 2001 Istalla Microsoft Silverlight!
ti puoi collegare a excel esattamente come se fosse un database e fare una query allo stesso modo

http://www.connectionstrings.com/?carrier=excel
http://www.dotnetjohn.com/articles.aspx?articleid=54

Modificato da theproject il 25 giugno 2008 14.13 -

Re: Tradurre una query a livello applicativo
bluland non è online. Ultima attività: 05/08/2008 13.24.23bluland
Inserito il: 02 luglio 2008 11.42
165 messaggi dal 17 apr 2006 Istalla Microsoft Silverlight!
Il problema che mi trovavo a dover fare una join, tra due sheet in due file divesi!

non sarebbe stato possibile farlo avendo due connessioni diverse a quanto ne so!

Ciao

Vincenzo Pesante
System Engineer
Re: Tradurre una query a livello applicativo
theproject non è online. Ultima attività: 03/08/2008 9.37.09theproject
Inserito il: 02 luglio 2008 12.30
57 messaggi dal 16 nov 2001 Istalla Microsoft Silverlight!
Vuoi fare un po troppe cose tutte assieme

Fai due select aprendo due connessioni e butti tutto in un db temporaneo dove poi estrai i dati.

Saranno un po penalizzate le prestazioni ....

Oppure il linguaggio sql prevede anche query da un'altra fonte ma non l'ho mai testata:

SELECT Name, Address
FROM PianoTuners IN "C:\Music\InstrumentTuners.xls" "Excel 5.0;"
WHERE state='TN'

http://www.devguru.com/technologies/jetsql/home.asp

Credo che teoricamente tu possa applicarci un bel JOIN


Vai a:
Torna al forum |   Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.


fabrica - 521 pt
vladimiro - 510 pt
stefanomnn - 242 pt

Ultimi vincitori: PeppeDotNet, fabrica, vladimiro

Iscriviti anche tu e raccogli punti. Questo mese in palio VS 2008 + Windows Server 2008, ReShaper e 1 ebook!



COMMUNITY
ULTIMI MESSAGGI


IN EVIDENZA
MISC
Powered by .db Forums