Multi-Union query Order by Sections?

So I have a Union query with 7 different queries. It is currently working great except for one small detail which is when it orders all of the results, it doesn't sectionalize them as how the SQL code is sectioned.......Here is the SQL code:

They don't order themselves as I need them to be seen and I don't want to have to put 1, 2, 3, etc. in front of each one just to order it the way I need it. Is there any way to avoid having to put 1, 2, 3, etc. in front of each one??

id you don't specify an order by clause on a select statement then the order in which the result set is return is RANDOM (well down to what the database engine determines is the most efficient manner in which to retrieve the data at that time...)

SQL is not processed in any particular top down manner (apart from the case statement where when expression ordering is important....)

so if you want rows return grouped by and in the order of each unioned select...
then you must ensure that each select has an Indicator value on ... (as jerryb30 has suggested) this however could mean that rows you currently lose as duplicates (you're using UNION not UNION all so an implicit DISTINCT is being applied presently) will no longer be removed so your query may need further modifications to produce the result you desire...

again since you are using UNION there is no point in have the DISTINCT statement on some of the individual selects as deduplication is going to occur anyway...

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.

Sorry for the late response, but I have been tinkering with the query and have it the way it should be except for one important part, which is that it now has

1. OrderID as the first column (in the order of 1 through 7 sequentially sectionalized as it should be)
2. Category as the second column (in the order sequentially sectionalized as it should be)
3. Entity as the third column (some sections are ordered sequentially while others aren't???) (this is the Provider's [full_name]). (Sidenote: not sure why it gave me a 'Duplicate output Alias name' error for "Entity" because the Original version I have still didn't give me any error about that when I had it set up the same??)

I can't figure out why some sections order the [full_name] in Ascending order while others don't??

Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…

Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

With just a little bit of SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form. If you have never written code or looked at an SQL statement before, no problem! ... give i…