If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Select .... Where Not.... ???

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-11-03, 10:18
ezagrai ezagrai is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
Question Select .... Where Not.... ???

Hi everybody!
I have a table in my database which containes the coordinates of corners of the boxes of the grid(the boxes can be any shape). It looks like this:

i j x1 y1 x2 y2 x3 y3 x4 y4

x1 x2= x3 x4
--------o----o---o------------ y1
| /\ |
| / \ |
| / \ |
| / \ |
| / \ | y2=y3
| \ / |
| \ / |
| \ / |
| \ / |
| \/ |
---------------------------- y4
I also have the point (x,y) and I need to define if this point is in the orthogonal box limited by the lines. I tryed to do it like this:

select * from table where not (((x<x1) and (x<x2) and (x<x3) and (x<x4)) or ((x>x1) and (x>x2) and (x>x3) and (x>x4)) or ((y<y1) and (y<y2) and (y<y3) and (y<y4)) or (((y>y1) and (y>y2) and (y>y3) and (y>y4)));

To say it in words : I want to select all the records where all 4 corners of the boxes are not from the left of the point, are not from the right of the point, are not below the point or are not beyond the point.
It didn't work. Does anybody have an idea how can I make it work?
I know my explanation is kind of messy, but please ask me if you are confused by it.

Thank you,

Elena
Reply With Quote
  #2 (permalink)  
Old 11-11-03, 10:20
ezagrai ezagrai is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
Sorry, the box which I tryed to draw was submitted in a very strange way... i just trryed to draw the box and the coordinates.
Reply With Quote
  #3 (permalink)  
Old 11-12-03, 02:29
khibinite khibinite is offline
Registered User
 
Join Date: Oct 2003
Posts: 63
Hi!

I think you need to draw it in any graphical editor and post this there by attaching.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On