Total War: WARHAMMER II

Total War: WARHAMMER II

Create and Share Custom Mods
The best mods for Total War: WARHAMMER II live here. Mods are made by players, for players and are not officially licensed by Games Workshop. Click 'Learn More' below to read our Modder’s Guide.
Learn More
math in assembely kit
hi!
i have some questions
I am using oparetors in tables?
how i use oparetors on Entire lines and rows?
ty תודה
< >
Showing 1-4 of 4 comments
need to be more specfice , really u need to look at the schema to see if it is key or depend. lua/xml based tabels like these mods are just data points/keys u need to insert a sciprt/compile a calulator ,that does the operation. id use note pad + or excell if u want to do it on rows tabels . notpad+ is very flexable and saves xml/excel tabel based things.
]this might be closer to the answer ur looking for though idk if its really pratical

https://www.red-gate.com/simple-talk/sql/performance/the-except-and-intersect-operators-in-sql-server/


The EXCEPT and INTERSECT Operators in SQL Server
The UNION, EXCEPT and INTERSECT operators of SQL enable you to combine more than one SELECT statement to form a single result set. The UNION operator returns all rows. The INTERSECT operator returns all rows that are in both result sets. The EXCEPT operator returns the rows that are only in the first result set but not in the second. Simple? Rob Sheldon explains all, with plenty of examples

Quite often, you’re faced with the task of comparing two or more tables, or query results, to determine which information is the same and which isn’t. One of the most common approaches to doing such a comparison is to use the UNION or UNION ALL operator to combine the relevant columns of the results that you want to compare. As long as you adhere to the restrictions placed on either of those operators, you can combine data sets whether they come from different databases or even different servers. With the UNION operator, you end up with a result containing every distinct row from the two results combined. However, it becomes more difficult to use UNION to return only the common data that is held in both results, or the different data that exists in one table but not the other(s). To get the results you need, you must use UNION ALL with a GROUP BY clause, though the logic isn’t always obvious on how to do this. And it isn’t any easier to use a JOIN operator to get the result you want. .

Enter the INTERSECT and EXCEPT operators. Beginning with SQL Server 2005, you can use these operators to combine queries and get the results you need. For instance, you can use the INTERSECT operator to return only values that match within both data sets, as shown in the following illustration .

1245-img3A.jpg

The illustration shows how the INTERSECT operator returns data that is common to both results set; the common data is represented by the area where the two circles intersect. The illustration also shows how the EXCEPT operator works; only data that exists in one of the data sets outside the intersecting area is returned. For instance, if Set A is specified to the left of the EXCEPT operator, only values that are not in Set B are returned. In the illustration above, that would be the data in the left circle, outside the section where the two data sets intersect. The following bullets sum up which operator to use to return different combinations of data:

To return the data in Set A that doesn’t overlap with B, use A EXCEPT B.
To return only the data that overlaps in the two sets, use A INTERSECT B.
To return the data in Set B that doesn’t overlap with A, use B EXCEPT A.
To return the data in all three areas without duplicates, use A UNION B.
To return the data in all three areas, including duplicates, use A UNION ALL B.
To return the data in the non-overlapping areas of both sets, use (A UNION B) except (A INTERSECT B), or perhaps (A EXCEPT B) UNION (B EXCEPT A)
The differences between the INTERSECT and EXCEPT operators and how to use each of them will become clearer as we work through the examples in the article. Just to give you a basic idea of how they work, we’ll start with a rather unrealistic example. To demonstrate those, however, we must first create two test views (using SQL Server 2005-compatible syntax). The first view contains a single column that describes what you might have had for lunch:

CREATE VIEW Lunch
AS
SELECT 'Beer' AS item
UNION SELECT 'Olives'
UNION SELECT 'Bread'
UNION SELECT 'Salami'
UNION SELECT 'Calamari'
UNION SELECT 'Coffee';
GO
The second view also contains a single column and describes what you might have had for dinner:

CREATE VIEW Dinner
AS
SELECT 'Wine' AS item
UNION SELECT 'Olives'
UNION SELECT 'Bread'
UNION SELECT 'Steak'
UNION SELECT 'Aubergines'
UNION SELECT 'Salad'
UNION SELECT 'Coffee'
UNION SELECT 'Apple';
GO
Now we can use these two views to demonstrate how to use the UNION, INTERSECT, and EXCEPT operators. I’ve also included a couple examples that use the JOIN operator to demonstrate the differences.

The first example uses the UNION operator to join the two views in order to return everything you’ve eaten today:

SELECT item FROM Lunch
UNION
SELECT item FROM Dinner;
Now we return the same data by using a full outer join:

SELECT DISTINCT COALESCE(Lunch.item, Dinner.item) AS item
FROM Lunch
FULL OUTER JOIN Dinner
ON Dinner.item = Lunch.item
Notice that the join requires more complex syntax; however, both statements return the same results, as shown in the following table:

item

Apple

Aubergines

Beer

Bread

Calamari

Coffee

Olives

Salad

Salami

Steak

Wine

Now let’s look at how you would return only the food you ate (or drank) for lunch, but did not have for dinner:

SELECT item FROM Lunch
EXCEPT
SELECT item FROM Dinner;
In this case, I used the EXCEPT operator to return the lunch-only items. I could have achieved the same results using the following left outer join:

SELECT Lunch.item
FROM Lunch
LEFT OUTER JOIN Dinner
ON Dinner.item = Lunch.item
WHERE dinner.item IS NULL;
Once again, you can see that the join is more complex, though the results are the same, as shown in the following table:

Item

Beer

Calamari

Salami

If you wanted to return those items you had for dinner but not lunch, you can again use the EXCEPT operator, but you must reverse the order of the queries, as shown in the following example:

SELECT item FROM Dinner
EXCEPT
SELECT item FROM Lunch;
Notice that I first retrieve the data from the Dinner view. To use the left outer join, you would again have to reverse the order of the tables:

SELECT dinner.item
FROM dinner
LEFT OUTER JOIN Lunch
ON Dinner.item = Lunch.item
WHERE Lunch.item IS NULL;
As expected, the results are the same for both SELECT statements:

item

Apple

Aubergines

Salad

Steak

Wine

In the next example, I use the INTERSECT operator to return only the food that was eaten at both meals:

SELECT item FROM Dinner
INTERSECT
SELECT item FROM Lunch;
As you can see, I simply connect the two queries with the INTERSECT operator, as I did with the EXCEPT operator. You can achieve the same results by using an inner join:

SELECT Dinner.item
FROM Dinner
INNER JOIN Lunch
ON Dinner.item = Lunch.item;
As the following results show, the only items you had at both meals were olives, bread, and coffee:

item

Bread

Coffee

Olives

Now let’s look at how you would return a list of food that you ate at one of the meals, but not both meals, in other words, the food you ate other than bread, olives, and coffee. In the following statement, I use a UNION operator to join two SELECT statements:

SELECT item
FROM
(
SELECT item FROM Lunch
EXCEPT SELECT item FROM Dinner
) Only_Lunch
UNION
SELECT item
FROM
(
SELECT item FROM Dinner
EXCEPT SELECT item FROM Lunch
) Only_Dinner; --Items you only ate once in the day.
Notice that first statement retrieves only the food you ate for lunch, and the second statement retrieves only the food ate for dinner. I achieve this in the same way I did in previous examples-by using the EXCEPT operator. I then used the UNION operator to join the two result sets. You can achieve the same results by using a full outer join:

SELECT COALESCE(Dinner.item, Lunch.item) AS item
FROM Dinner
FULL OUTER JOIN Lunch
ON Dinner.item = Lunch.item
WHERE Dinner.item IS NULL OR Lunch.item IS NULL;
In both examples, the statements return the following results:

item

Apple

Aubergines

Beer

Calamari

Salad

Salami

Steak

Wine

From this point on, I developed the examples on a local instance of SQL Server 2008 and the AdventureWorks2008 database. Each example uses either the INTERSECT or EXCEPT operator to compare data between the Employee and JobCandidate tables, both part of the HumanResources schema. The comparison is based on the BusinessEntityID column in each table. The BusinessEntityID column in the Employee table is the primary key. In the JobCandidate table, the BusinessEntityID column is a foreign key that references the BusinessEntityID column in the Employee table. The column in the JobCandidate table also permits null values.


hope that helps. its greek to me.




Last edited by {COR}Lucian{K-IV}; 8 Apr, 2019 @ 11:28am
Cream the Rabbit 9 Apr, 2019 @ 6:55am 
Originally posted by lucian)exxtreamslayer(lucain:
need to be more specfice , really u need to look at the schema to see if it is key or depend. lua/xml based tabels like these mods are just data points/keys u need to insert a sciprt/compile a calulator ,that does the operation. id use note pad + or excell if u want to do it on rows tabels . notpad+ is very flexable and saves xml/excel tabel based things.
]this might be closer to the answer ur looking for though idk if its really pratical

https://www.red-gate.com/simple-talk/sql/performance/the-except-and-intersect-operators-in-sql-server/


The EXCEPT and INTERSECT Operators in SQL Server
The UNION, EXCEPT and INTERSECT operators of SQL enable you to combine more than one SELECT statement to form a single result set. The UNION operator returns all rows. The INTERSECT operator returns all rows that are in both result sets. The EXCEPT operator returns the rows that are only in the first result set but not in the second. Simple? Rob Sheldon explains all, with plenty of examples

Quite often, you’re faced with the task of comparing two or more tables, or query results, to determine which information is the same and which isn’t. One of the most common approaches to doing such a comparison is to use the UNION or UNION ALL operator to combine the relevant columns of the results that you want to compare. As long as you adhere to the restrictions placed on either of those operators, you can combine data sets whether they come from different databases or even different servers. With the UNION operator, you end up with a result containing every distinct row from the two results combined. However, it becomes more difficult to use UNION to return only the common data that is held in both results, or the different data that exists in one table but not the other(s). To get the results you need, you must use UNION ALL with a GROUP BY clause, though the logic isn’t always obvious on how to do this. And it isn’t any easier to use a JOIN operator to get the result you want. .

Enter the INTERSECT and EXCEPT operators. Beginning with SQL Server 2005, you can use these operators to combine queries and get the results you need. For instance, you can use the INTERSECT operator to return only values that match within both data sets, as shown in the following illustration .

1245-img3A.jpg

The illustration shows how the INTERSECT operator returns data that is common to both results set; the common data is represented by the area where the two circles intersect. The illustration also shows how the EXCEPT operator works; only data that exists in one of the data sets outside the intersecting area is returned. For instance, if Set A is specified to the left of the EXCEPT operator, only values that are not in Set B are returned. In the illustration above, that would be the data in the left circle, outside the section where the two data sets intersect. The following bullets sum up which operator to use to return different combinations of data:

To return the data in Set A that doesn’t overlap with B, use A EXCEPT B.
To return only the data that overlaps in the two sets, use A INTERSECT B.
To return the data in Set B that doesn’t overlap with A, use B EXCEPT A.
To return the data in all three areas without duplicates, use A UNION B.
To return the data in all three areas, including duplicates, use A UNION ALL B.
To return the data in the non-overlapping areas of both sets, use (A UNION B) except (A INTERSECT B), or perhaps (A EXCEPT B) UNION (B EXCEPT A)
The differences between the INTERSECT and EXCEPT operators and how to use each of them will become clearer as we work through the examples in the article. Just to give you a basic idea of how they work, we’ll start with a rather unrealistic example. To demonstrate those, however, we must first create two test views (using SQL Server 2005-compatible syntax). The first view contains a single column that describes what you might have had for lunch:

CREATE VIEW Lunch
AS
SELECT 'Beer' AS item
UNION SELECT 'Olives'
UNION SELECT 'Bread'
UNION SELECT 'Salami'
UNION SELECT 'Calamari'
UNION SELECT 'Coffee';
GO
The second view also contains a single column and describes what you might have had for dinner:

CREATE VIEW Dinner
AS
SELECT 'Wine' AS item
UNION SELECT 'Olives'
UNION SELECT 'Bread'
UNION SELECT 'Steak'
UNION SELECT 'Aubergines'
UNION SELECT 'Salad'
UNION SELECT 'Coffee'
UNION SELECT 'Apple';
GO
Now we can use these two views to demonstrate how to use the UNION, INTERSECT, and EXCEPT operators. I’ve also included a couple examples that use the JOIN operator to demonstrate the differences.

The first example uses the UNION operator to join the two views in order to return everything you’ve eaten today:

SELECT item FROM Lunch
UNION
SELECT item FROM Dinner;
Now we return the same data by using a full outer join:

SELECT DISTINCT COALESCE(Lunch.item, Dinner.item) AS item
FROM Lunch
FULL OUTER JOIN Dinner
ON Dinner.item = Lunch.item
Notice that the join requires more complex syntax; however, both statements return the same results, as shown in the following table:

item

Apple

Aubergines

Beer

Bread

Calamari

Coffee

Olives

Salad

Salami

Steak

Wine

Now let’s look at how you would return only the food you ate (or drank) for lunch, but did not have for dinner:

SELECT item FROM Lunch
EXCEPT
SELECT item FROM Dinner;
In this case, I used the EXCEPT operator to return the lunch-only items. I could have achieved the same results using the following left outer join:

SELECT Lunch.item
FROM Lunch
LEFT OUTER JOIN Dinner
ON Dinner.item = Lunch.item
WHERE dinner.item IS NULL;
Once again, you can see that the join is more complex, though the results are the same, as shown in the following table:

Item

Beer

Calamari

Salami

If you wanted to return those items you had for dinner but not lunch, you can again use the EXCEPT operator, but you must reverse the order of the queries, as shown in the following example:

SELECT item FROM Dinner
EXCEPT
SELECT item FROM Lunch;
Notice that I first retrieve the data from the Dinner view. To use the left outer join, you would again have to reverse the order of the tables:

SELECT dinner.item
FROM dinner
LEFT OUTER JOIN Lunch
ON Dinner.item = Lunch.item
WHERE Lunch.item IS NULL;
As expected, the results are the same for both SELECT statements:

item

Apple

Aubergines

Salad

Steak

Wine

In the next example, I use the INTERSECT operator to return only the food that was eaten at both meals:

SELECT item FROM Dinner
INTERSECT
SELECT item FROM Lunch;
As you can see, I simply connect the two queries with the INTERSECT operator, as I did with the EXCEPT operator. You can achieve the same results by using an inner join:

SELECT Dinner.item
FROM Dinner
INNER JOIN Lunch
ON Dinner.item = Lunch.item;
As the following results show, the only items you had at both meals were olives, bread, and coffee:

item

Bread

Coffee

Olives

Now let’s look at how you would return a list of food that you ate at one of the meals, but not both meals, in other words, the food you ate other than bread, olives, and coffee. In the following statement, I use a UNION operator to join two SELECT statements:

SELECT item
FROM
(
SELECT item FROM Lunch
EXCEPT SELECT item FROM Dinner
) Only_Lunch
UNION
SELECT item
FROM
(
SELECT item FROM Dinner
EXCEPT SELECT item FROM Lunch
) Only_Dinner; --Items you only ate once in the day.
Notice that first statement retrieves only the food you ate for lunch, and the second statement retrieves only the food ate for dinner. I achieve this in the same way I did in previous examples-by using the EXCEPT operator. I then used the UNION operator to join the two result sets. You can achieve the same results by using a full outer join:

SELECT COALESCE(Dinner.item, Lunch.item) AS item
FROM Dinner
FULL OUTER JOIN Lunch
ON Dinner.item = Lunch.item
WHERE Dinner.item IS NULL OR Lunch.item IS NULL;
In both examples, the statements return the following results:

item

Apple

Aubergines

Beer

Calamari

Salad

Salami

Steak

Wine

From this point on, I developed the examples on a local instance of SQL Server 2008 and the AdventureWorks2008 database. Each example uses either the INTERSECT or EXCEPT operator to compare data between the Employee and JobCandidate tables, both part of the HumanResources schema. The comparison is based on the BusinessEntityID column in each table. The BusinessEntityID column in the Employee table is the primary key. In the JobCandidate table, the BusinessEntityID column is a foreign key that references the BusinessEntityID column in the Employee table. The column in the JobCandidate table also permits null values.


hope that helps. its greek to me.
ty very match very ditelet answer
to be mor spesific i mean wen i using the tabels in Twek
and i want to * or - sertin chambers
togever like
chmber 1 2 and 3 * 7
that was from the site. , lango barrier, thats greek to me
evcimen 14 Jan, 2022 @ 7:06am 
SİÜÜÜÜÜÜÜÜÜÜÜ
< >
Showing 1-4 of 4 comments
Per page: 1530 50