Answer the question
In order to leave comments, you need to log in
Can such a request be made?
Let's say there is a table regions: x | y | z it stores records like this: 12-20 | 0-30 | 14-25, that is, ranges of numbers, to make it clear, I write two points to the database: A (12; 0; 14) and B (20; 30; 25), this is my cube diagonal. And I need to check if point O(5; 5; 5) is in the given cube. I do not think that this can be done in a query, but at least tell me how best to implement this?
Answer the question
In order to leave comments, you need to log in
Based on the conditions of the problem, the structure of your database is incorrect.
Store data as:
Ax, Ay, Az, Bx, By, Bz.
And then the primitive
SELECT * FROM diagonal
WHERE Ox > Ax AND Ox < Bx AND Oy > Ay AND Oy < By AND Oz > Az AND Oz < Bz
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question