Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query against array

Status
Not open for further replies.

lothadio

Programmer
Apr 5, 2001
27
SI
I am using PHP 4.02 and MSSQL Server 7.0

///////////////I have this array/////////

AA0101
AA0202
AA0303
AA0404
AA0505
AA0606
AA0707
AA0808
AA0909
AA1010


////////////////I have this table////////



document_number id
AA0101 1
AA0202 2
AA0303 3
AA0404 4
AA0505 5
AA0606 6
AA0707 7
AA0808 8
AA0909 9
AA1010 10
AA1111 11
AA1212 12
AA1313 13
AA1414 14
AA1515 15
AA1616 16
AA1717 17
AA1818 18
AA1919 19
AA2020 20

//////////////////I want to build a query that will out put a result of all the records that are NOT LIKE the array values.


///////////Example I want the result to be:///

AA1111 11
AA1212 12
AA1313 13
AA1414 14
AA1515 15
AA1616 16
AA1717 17
AA1818 18
AA1919 19
AA2020 20

How do I do this?

Thanks

 

You could build a query that uses the Not In clause.

Select * From table1
Where document_number Not In ('AA0101', 'AA0202', 'AA0303', 'AA0404', ....)

Terry

X-) "Life would be easier if I had the source code." -Anonymous
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top