473,395 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Sorting in query with Union

Hi,

I am attempting to write a complex query to group sets of data. I have my
query working correctly, but i ran into a problem with sorting.

I want to sort my query by a string field.

Is there a way around sorting using a field other than numeric of a query
containing a union?

Thanks,

Karen
Jul 20 '05 #1
1 8008
On Fri, 24 Oct 2003 13:10:51 -0400, "Karen Bailey"
<ka****@centurysystems.net> wrote:
Hi,

I am attempting to write a complex query to group sets of data. I have my
query working correctly, but i ran into a problem with sorting.

I want to sort my query by a string field.

Is there a way around sorting using a field other than numeric of a query
containing a union?

Thanks,

Karen


You could do something like:

use northwind

(
select city
from customers
union
select city
from employees
)
order by city desc
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: guitarromantic | last post by:
Hey, I have a 'staff' table with a column 'status', corresponding to a 'statuses' table with the appropriate titles (eg 1 | Editor in Chief). I want to display on the page the headings (the...
7
by: Not Me | last post by:
Hi, Having a table with some duplicate ID's (different data tho), how can I return the list but with only one record from each ID? Would this be using the first() function and grouping? ...
4
by: Anna | last post by:
Hi all, I have a query in ASP.NET that selects text from a memo field in Access (among other things). The query appears to be truncating the text at 255 characters. I've done a little research...
6
by: GJW | last post by:
Does anybody know a simply way I can run a query on a single table and merge the results of several columns of data into a single column of data? IE Table1: First Name Second Name...
7
by: KoliPoki | last post by:
Hello every body. I have a small issue. Problem: I have a table with 4 descriptor columns (type). I need to formulate a query to retrieve a count for each type so I can group by...etc. The...
34
mkuberski
by: mkuberski | last post by:
I have a database with 3 tables, Mailing_List, All_Seminars and Proximity_Results. The Mailing_List is a list of customers and their address, All_Seminars is a list of seminar locations and the...
6
by: tom_b | last post by:
Hi, I'm using Mysql and PHP,I have a simple table in my DB, looks something like this: id jim bob bill 1 20 30 15 2 20 35 15 etc, what i need to do is get the sums...
1
by: ebasshead | last post by:
Hi Everyone I have four queries that Ive joined in a union query and want to add a date criteria ei between and including date A and date B. Ive tried a few things but getting errors. Can someone...
11
by: michaelperl | last post by:
hi all ! I need some help please I'm using a database tool for developing and driving dynamic content. With the tool I use I make queries based on my tables and I set the sorting order of my...
2
by: samul | last post by:
very simple i would think to those who would know what to do but having a hard time: i've addresses. street names and addresses on the streets. so those are the two fields. i want to arrange the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.