Re: Manually Inserted Data
I did this on my computer create table site_calendar_v2 ( id int,start date,end date,global int, status varchar(20),time timestamp not null default now()); SELECT A.ID,A.Start,A.End FROM ((SELECT ID, Start, End FROM site_calendar_v2 as c WHERE Global='1' ) UNION ( SELECT '9', '2006-11-01', '-00-00')) A ORDER BY End, Start ASC, Status DESC, Time ASC; When I ran it, it gave me this ERROR 1054 (42S22): Unknown column 'Status' in 'order clause' Just extend the SELECT list to have the STATUS and a TIME like this: SELECT A.ID,A.Start,A.End FROM ((SELECT ID, Start, End , STATUS, TIME FROM site_calendar_v2 as c WHERE Global='1' ) UNION ( SELECT '9', '2006-11-01', '-00-00', 'no status', '-00-00 00:00:00')) A ORDER BY End, Start ASC, Status DESC, Time ASC; With no rows in the site_calendar_v2 table, I got back this: +---+++ | ID| Start | End| +---+++ | 9 | 2006-11-01 | -00-00 | +---+++ Give it a try. - Original Message - From: Gerald L. Clark [EMAIL PROTECTED] To: Keith Spiller [EMAIL PROTECTED] Cc: [MySQL] mysql@lists.mysql.com Sent: Wednesday, November 1, 2006 4:51:21 PM GMT-0500 US/Eastern Subject: Re: Manually Inserted Data Keith Spiller wrote: Hi Rolando, Thanks for your help. I have reduced the query to the bare essensials to try to test the concept, but it still fails... ( SELECT ID, Start, End ( SELECT ID, Start, End as z FROM site_calendar_v2 as c WHERE Global='1' ) UNION ( SELECT '9', '2006-11-01', '-00-00' as z ) ORDER BY z, Start ASC, Status DESC, Time ASC a Does anyone see my mistake? Keith -- Gerald L. Clark Supplier Systems Corporation -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Manually Inserted Data
Hi, I'm trying to manually insert data into a mysql query so that the data will be sorted by the query but not inserted into the table. Here's what I have so far: ( SELECT ID, Title, Label, Location, Start, End, Time, Description, Organization, Department, Contact, Phone, Email, Global, Board, Committee, Status, TBD_Time , TO_DAYS(End) - TO_DAYS(Start) + 1 AS Days FROM site_calendar WHERE Global='1' ) UNION ( SELECT '9', 'No events exist for this month...', '', '', '', '-00-00', '00:00:00', '', '', '', '', '', '', '1', '', '', '', '', as z ) ORDER BY z, Start ASC, Status DESC, Time ASC I just don't know what I am doing wrong her, or how to accomplish this task. Please help. Thanks, Keith -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Manually Inserted Data
The first UNION part has 19 columns the other UNION part has 18 columns - Original Message - From: Keith Spiller [EMAIL PROTECTED] To: [MySQL] mysql@lists.mysql.com Sent: Wednesday, November 1, 2006 3:31:24 PM GMT-0500 US/Eastern Subject: Manually Inserted Data Hi, I'm trying to manually insert data into a mysql query so that the data will be sorted by the query but not inserted into the table. Here's what I have so far: ( SELECT ID, Title, Label, Location, Start, End, Time, Description, Organization, Department, Contact, Phone, Email, Global, Board, Committee, Status, TBD_Time , TO_DAYS(End) - TO_DAYS(Start) + 1 AS Days FROM site_calendar WHERE Global='1' ) UNION ( SELECT '9', 'No events exist for this month...', '', '', '', '-00-00', '00:00:00', '', '', '', '', '', '', '1', '', '', '', '', as z ) ORDER BY z, Start ASC, Status DESC, Time ASC I just don't know what I am doing wrong her, or how to accomplish this task. Please help. Thanks, Keith -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Manually Inserted Data
Hi Rolando, Thanks for your help. I have reduced the query to the bare essensials to try to test the concept, but it still fails... ( SELECT ID, Start, End FROM site_calendar_v2 as c WHERE Global='1' ) UNION ( SELECT '9', '2006-11-01', '-00-00' as z ) ORDER BY z, Start ASC, Status DESC, Time ASC a Does anyone see my mistake? Keith - Original Message - From: Rolando Edwards [EMAIL PROTECTED] To: Keith Spiller [EMAIL PROTECTED] Cc: MySQL mysql@lists.mysql.com Sent: Wednesday, November 01, 2006 2:11 PM Subject: Re: Manually Inserted Data The first UNION part has 19 columns the other UNION part has 18 columns - Original Message - From: Keith Spiller [EMAIL PROTECTED] To: [MySQL] mysql@lists.mysql.com Sent: Wednesday, November 1, 2006 3:31:24 PM GMT-0500 US/Eastern Subject: Manually Inserted Data Hi, I'm trying to manually insert data into a mysql query so that the data will be sorted by the query but not inserted into the table. Here's what I have so far: ( SELECT ID, Title, Label, Location, Start, End, Time, Description, Organization, Department, Contact, Phone, Email, Global, Board, Committee, Status, TBD_Time , TO_DAYS(End) - TO_DAYS(Start) + 1 AS Days FROM site_calendar WHERE Global='1' ) UNION ( SELECT '9', 'No events exist for this month...', '', '', '', '-00-00', '00:00:00', '', '', '', '', '', '', '1', '', '', '', '', as z ) ORDER BY z, Start ASC, Status DESC, Time ASC I just don't know what I am doing wrong her, or how to accomplish this task. Please help. Thanks, Keith -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Manually Inserted Data
Keith Spiller wrote: Hi Rolando, Thanks for your help. I have reduced the query to the bare essensials to try to test the concept, but it still fails... ( SELECT ID, Start, End ( SELECT ID, Start, End as z FROM site_calendar_v2 as c WHERE Global='1' ) UNION ( SELECT '9', '2006-11-01', '-00-00' as z ) ORDER BY z, Start ASC, Status DESC, Time ASC a Does anyone see my mistake? Keith -- Gerald L. Clark Supplier Systems Corporation -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]