I am trying to design a query with OR and NAND operation, Can some one let me know Is the query is correct:
Question 1: Is this query correct?
select * from country where country_code='AL' UNION (SELECT * from country
WHERE country_id NOT IN
(SELECT country_id from country
where country_name='Land islands'
UNION
SELECT country_id from country
where country_code='AX'
));
I created the query with the help of my another question of mine;
Question 2:
I want to use 5 query with AND,NOT,NAND,OR operation in between them. I created up to 3 (Check my Question 1) I need help for creating 5 Select Queries.
My Application is search application where the user can search the database with i5 query block in between each block we have operations like below I mentioned. But the operations are carried out in one single table.
Explanation:
I want to select records inside a table and I will use many operations in between the table. MAX 5 operation in side a query.
Query 1,Query 2, Query 3, Query 4, Query 5.
Cases:
(Query 1 AND Query 2 OR Query 3 NAND Query 4 NOT Query 5)
(Query 1 OR Query 2 OR Query 3 OR Query 4 OR Query 5)
(Query 1 AND Query 2 AND Query 3 AND Query 4 AND Query 5)
(Query 1 NOT Query 2 NOT Query 3 NOT Query 4 NOT Query 5)
etc.. The operation in between the query Block may vary... I will write my PHP script according to that but I want to perform the Logic in such a way that I can join each logic..
Now I need an help