Unix Technical Forum

Manually Inserted Data

This is a discussion on Manually Inserted Data within the MySQL General forum forums, part of the MySQL category; --> Hi, I'm trying to manually insert data into a mysql query so that the data will be sorted by ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 05:08 AM
Keith Spiller
 
Posts: n/a
Default 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 '99999', 'No events exist for this month...', '', '', '',
'0000-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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 05:08 AM
Rolando Edwards
 
Posts: n/a
Default Re: Manually Inserted Data

The first UNION part has 19 columns
the other UNION part has 18 columns

----- Original Message -----
From: Keith Spiller <larentium@hosthive.com>
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 '99999', 'No events exist for this month...', '', '', '',
'0000-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/mysql?unsub=redwards@swmx.com


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 05:08 AM
Keith Spiller
 
Posts: n/a
Default 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 '99999', '2006-11-01', '0000-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" <redwards@swmx.com>
To: "Keith Spiller" <larentium@hosthive.com>
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 <larentium@hosthive.com>
> 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 '99999', 'No events exist for this month...', '', '', '',
> '0000-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/mysql?unsub=redwards@swmx.com
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=l...m@hosthive.com


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com