dbTalk Databases Forums  

Paradox + IN

comp.databases.paradox comp.databases.paradox


Discuss Paradox + IN in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sirtap
 
Posts: n/a

Default Paradox + IN - 07-11-2007 , 09:04 AM






Hi

I have a problem with a composite key in the Paradox database. I want to
select rows using a list of key pairs I have. I want to use IN clause. In
most relational databases it would be something like that:

SELECT * FROM Table1 WHERE (A,B) NOT IN ((1,1),(2,10))

A and B are composite key.

But in Paradox (standard version on Windows XP) it doesn't work.

Regards

Andrew



Reply With Quote
  #2  
Old   
Ed Nash
 
Posts: n/a

Default Re: Paradox + IN - 07-11-2007 , 10:06 AM






Here's an (untested) idea with psuedo-SQL. If fields A and B are
already CHAR, then there would be no need to CAST. Make sure you get
the exact CAST syntax correct by reading the Paradox LocalSQL help as I
am just guessing here.


SELECT * FROM Table1 WHERE CAST(A AS CHAR) || CAST(B AS CHAR) NOT IN
('ConcatenatedValueOne', 'ConcatenatedValueTwo')



Reply With Quote
  #3  
Old   
sirtap
 
Posts: n/a

Default Re: Paradox + IN - 07-11-2007 , 10:33 AM



"Ed Nash" <ask.me (AT) specifically (DOT) pls> wrote

Quote:
Here's an (untested) idea with psuedo-SQL. If fields A and B are already
CHAR, then there would be no need to CAST. Make sure you get the exact
CAST syntax correct by reading the Paradox LocalSQL help as I am just
guessing here.


SELECT * FROM Table1 WHERE CAST(A AS CHAR) || CAST(B AS CHAR) NOT IN
('ConcatenatedValueOne', 'ConcatenatedValueTwo')


Quite interesting, but I've already done it like that:

WHERE NOT (
(A = 1 AND B = 1 ) OR
(A = 2 AND B = 3 ));

Regards
Andrew




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.