X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 137818B9FE2 for ; Thu, 17 Feb 2005 15:47:26 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 44731-05 for ; Thu, 17 Feb 2005 15:47:19 +0000 (GMT) Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.250.190.2]) by svr1.postgresql.org (Postfix) with ESMTP id 5F8AF8B9FB2 for ; Thu, 17 Feb 2005 15:47:22 +0000 (GMT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 878AB31FE3; Thu, 17 Feb 2005 16:47:23 +0100 (MET) From: "WeiShang" X-Newsgroups: pgsql.sql Subject: VIEW / ORDER BY + UNION Date: Thu, 17 Feb 2005 23:46:59 +0800 Organization: Hub.Org Networking Services Lines: 28 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.757 tagged_above=0 required=5 tests=PRIORITY_NO_NAME, SUBJ_ALL_CAPS, UPPERCASE_25_50 X-Spam-Level: * X-Archive-Number: 200502/262 X-Sequence-Number: 20371 Hi, I have created a view like this : CREATE VIEW v1 AS (SELECT orderno,weekday,time FROM t1,t2 where t1.orderno=t2.orderno); if I create a SQL statment: (SELECT orderno FROM v1 WHERE weekday='MON' ORDER BY orderno) UNION (SELECT orderno FROM v1 WHERE weekday='WED' ORDER BY orderno) UNION (SELECT orderno FROM v1 WHERE weekday='FRI' ORDER BY orderno); Will the whole result will be sorted by the field orderno? Thanks, WeiShang