RE: Merging Databases

2009-05-11 Thread Weston, Craig (OFT)
-Original Message- From: Johnny Withers [mailto:joh...@pixelated.net] Sent: Monday, May 11, 2009 3:30 PM To: MySQL General List Subject: Merging Databases Hi, I have a lot of databases that have the exact same tables and each table has the exact same column structure. I'm looking at merg

RE: Need to pivot rows into columns

2009-01-22 Thread Weston, Craig (OFT)
From: Attila [mailto:attee...@gmail.com] Sent: Thursday, January 22, 2009 3:06 PM To: mysql@lists.mysql.com Subject: Need to pivot rows into columns ... I am using MySQL and have found some possibilities with SQL Server (Pivot, crosstab, etc) ... but the requirements call for MySQL. Is the above q

RE: SELECT with replacement chars

2008-12-05 Thread Weston, Craig (OFT)
>Hi >how can i replace, in a SELECT query, the last 3 numbers with asterisks? >from 0123456789 to 0123456*** My psudocode for this would be something like: Select CONCAT(left$(`field`,(LENGTH(a)-3),'***') >From `table` But there might be more efficient ideas out there. --

RE: Access Rights ?

2008-10-06 Thread Weston, Craig (OFT)
This problem is Chapter 16.6 of The MYSQL Cookbook, (second edition) that has made my(sql) life much easier. You might want to look around at http://artfulsoftware.com/ which has lots of examples and a great e-book resource. Both of these are fantastic resources for me, and they are probably my m

RE: Many to many to too many relation.

2008-09-30 Thread Weston, Craig (OFT)
k you. -Original Message- From: Rob Wultsch [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 30, 2008 10:11 AM To: Weston, Craig (OFT) Cc: mysql@lists.mysql.com Subject: Re: Many to many to too many relation. Luck for you my vpn appears to be screwed up. Here is a stored proc I whipp

RE: Many to many to too many relation.

2008-09-30 Thread Weston, Craig (OFT)
Wow, I do feel very lucky. I am only at the "this is a cursor" part. I sincerely appreciate your help. -Original Message- From: Rob Wultsch [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 30, 2008 10:11 AM To: Weston, Craig (OFT) Cc: mysql@lists.mysql.com Subject: R

RE: Many to many to too many relation.

2008-09-30 Thread Weston, Craig (OFT)
data (as simple as possible), a simple psuedo code query and example output of what you want returned. On Mon, Sep 29, 2008 at 2:00 PM, Weston, Craig (OFT) <[EMAIL PROTECTED]> wrote: > Hello everyone. > > > > I have a complex situation. I have a list of related records (see &g

Many to many to too many relation.

2008-09-29 Thread Weston, Craig (OFT)
Hello everyone. I have a complex situation. I have a list of related records (see partial extract below) where I am trying to determine the unique lowest number for each relation. This number should always be an AB number, since all the MA numbers will always relate to an AB number. I need the

RE: Combining Multiple Tables

2008-09-26 Thread Weston, Craig (OFT)
Use null (or custom text) to replace the missing columns A quick ex: Select a,b,c,null,d from table1 Union all Select d,'test valid',e,f,g from table 2 This e-mail, including any attachments, may be confidential, privileged or otherwis

RE: Database Creating

2008-08-07 Thread Weston, Craig (OFT)
I would like to create my first mysql database. Is there a gui tool that makes this easy to do? Thanks, Andrew Try Toad - http://toadsoft.com/toadmysql/mysql_freeware.htm This e-mail, including any attachments, may be confidential, privile

RE: Calendar creation

2008-07-17 Thread Weston, Craig (OFT)
Thanks, everybody! Craig Weston nfrastructure Contractor NYS CIO/OFT Enterprise Helpdesk Management 518-486-4569 [EMAIL PROTECTED] -Original Message- From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2008 2:26 PM To: Weston, Craig (OFT) Cc: mysql@lists.mysql.com

Calendar creation

2008-07-17 Thread Weston, Craig (OFT)
Hi there, Is there any simple way to create a calendar table? For example I want to create a reference calendar containing all the dates of several years so I can accurately represent even days where I have no data in my data set. Any ideas? Thanks, Craig

date list including dates not in the list

2008-01-29 Thread Weston, Craig (OFT)
Hi there, I have a list of events that occur periodically: 1/1/2008Event 1/1/2008Event 1/1/2008Event 1/2/2008Event 1/2/2008Event 1/4/2008Event 1/4/2008Event I know how to count events per day, but on

RE: [MYSQL]time of elapsed time

2007-10-19 Thread Weston, Craig (OFT)
y the sender immediately by reply e-mail and delete the e-mail from your system. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 19, 2007 12:02 PM To: mysql@lists.mysql.com Subject: Re: [MYSQL]time of elapsed time Weston, Craig (OFT) wrote: &

RE: [MYSQL]time of elapsed time

2007-10-19 Thread Weston, Craig (OFT)
ail from your system. -Original Message- From: Baron Schwartz [mailto:[EMAIL PROTECTED] Sent: Friday, October 19, 2007 8:53 AM To: Weston, Craig (OFT) Cc: mysql@lists.mysql.com Subject: Re: [MYSQL]time of elapsed time Hi Craig, Weston, Craig (OFT) wrote: > Hello everyone. > > Onc

[MYSQL]time of elapsed time

2007-10-19 Thread Weston, Craig (OFT)
Hello everyone. Once again, I am jousting at the windmill of time and date formulae within MYSQL. I seek to create a cross-tab or pivot table of the SUM of all times with a specific category, on a per-ticket basis. I have everything working except the math part. Even that is kind of working ok, b

RE: [mysql] Text = Tinytext = MediumText = LongText?

2007-10-18 Thread Weston, Craig (OFT)
AM To: mysql@lists.mysql.com Subject: Re: [mysql] Text = Tinytext = MediumText = LongText? Sebastian Mendel schrieb: > Weston, Craig (OFT) schrieb: >> Hello everyone, hopefully a quick question: is there a functional >> difference between the various text field sizes other

[mysql] Text = Tinytext = MediumText = LongText?

2007-10-17 Thread Weston, Craig (OFT)
Hello everyone, hopefully a quick question: is there a functional difference between the various text field sizes other than size? For example if I wanted to could I run a FULLTEXT index against a LongText field? The collary is of course how good of an idea is this, assuming that MOST of the d

RE: Count syntax

2007-09-28 Thread Weston, Craig \(OFT\)
Beauford, you might find this article on cross joins interesting, it was something shown to me a few weeks ago that discusses this kind of function. http://dev.mysql.com/tech-resources/articles/wizard/print_version.html Cheers, craig This

RE: [mysql] duplicating lines

2007-09-14 Thread Weston, Craig \(OFT\)
: Friday, September 14, 2007 12:28 PM To: Weston, Craig (OFT) Cc: Jay Pipes; mysql@lists.mysql.com Subject: Re: [mysql] duplicating lines I think you want to use a GROUP BY query. Try this article: http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row -per-group-in-sql/ Baron Weston

RE: [mysql] duplicating lines

2007-09-14 Thread Weston, Craig (OFT)
TED] Sent: Thursday, September 13, 2007 1:27 PM To: Weston, Craig (OFT) Cc: mysql@lists.mysql.com Subject: Re: [mysql] duplicating lines Hi Craig, would you mind posting the SHOW CREATE TABLE for the tables in question? I'm having trouble determining what is the primary key for your se

RE: Does this MySQL client exist?

2007-09-13 Thread Weston, Craig \(OFT\)
You could look at Navicat, a non-free interface, does SSH and so on. http://navicat.com/index.html This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addres

[mysql] duplicating lines

2007-09-13 Thread Weston, Craig \(OFT\)
Hello again, I am having a duplication of results problem. I believe my query (below) is giving me exactly what I deserve in writing it. What it returns to me is a row for each status. What I would most want would be a single row with the oldest status - IE the status datetime that

RE: [MYSQL]Time formatting for cycle time.

2007-08-29 Thread Weston, Craig \(OFT\)
Peter, Baron and all, I think that I am almost there. Here's my query to return cycle time in hours:minutes:seconds accounting for business hours. There is some discussion as to when a ticket cycle time ends - for example if a person works on a ticket at 10:00 at night and closes it, i

RE: [MYSQL]Time formatting for cycle time.

2007-08-28 Thread Weston, Craig \(OFT\)
Ok then, Now I have a result set so very close to where I want to be. The query thus far: mysql> SET @d1 = '2007-02-01 18:24:04';# Start date SET @d2 = '2007-2-28 23:05:40';# End date set @wkldays = (select WorkDayDiff`(@d2,@d1)-1); Set @wkldays2 = if(@wkldays < 0,1,0); set @Day_End = (select `

RE: [MYSQL]Time formatting for cycle time.

2007-08-28 Thread Weston, Craig \(OFT\)
Ok, So, What I have come up with (so far) as a variant of Baron's query: SET @d1 = '2007-2-1 00:00:00';# Start date SET @d2 = '2007-2-28 23:59:59';# End date SET @tdiff = TIMEDIFF( TIME(@d1), TIME(@d2) ); SET @dow1 = DAYOFWEEK(@d1); SET @dow2 = DAYOFWEEK(@d2); SET @days = DATEDIFF(@d2,@d1); SET

RE: [MYSQL]Time formatting for cycle time.

2007-08-28 Thread Weston, Craig (OFT)
Wow, thanks. Lots to think about. From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Monday, August 27, 2007 10:18 PM To: Weston, Craig (OFT) Cc: mysql@lists.mysql.com Subject: Re: [MYSQL]Time formatting for cycle time. Craig, >I am working on Mar

[MYSQL]Time formatting for cycle time.

2007-08-27 Thread Weston, Craig \(OFT\)
Hello all, I am working on Martin Minka's date diff function as found at http://forge.mysql.com/snippets/view.php?id=56. It is a beautiful thing. However, I am trying to alter it or identify a similar function that instead of giving me the number of days between two dates it returns

RE: [mysql] reverse join

2007-08-02 Thread Weston, Craig (OFT)
Thanks for your help. From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 10:47 AM To: Weston, Craig (OFT); mysql@lists.mysql.com Subject: Re: [mysql] reverse join Craig >How do I pull out all the non-duplicate records? W

[mysql] reverse join

2007-08-02 Thread Weston, Craig \(OFT\)
Hi there, I have a situation where I have duplicate data within several tables, but they are all indexed in the same way. How do I pull out all the non-duplicate records? Would I have to create a temporary table, add one data set, then add the second where it doesn't equal the

RE: [mysql] crosstabs

2007-07-31 Thread Weston, Craig \(OFT\)
31, 2007 3:56 PM To: Weston, Craig (OFT) Cc: mysql@lists.mysql.com Subject: Re: [mysql] crosstabs Hi, Weston, Craig (OFT) wrote: > In Access, designing a "crosstab" query is fairly straight forward. You > just choose "crosstab" in the query design form. Is there some

[mysql] crosstabs

2007-07-31 Thread Weston, Craig \(OFT\)
In Access, designing a "crosstab" query is fairly straight forward. You just choose "crosstab" in the query design form. Is there some simple way to replicate this functionality within mysql? Thanks, Craig This e-mail, including any atta

[MYSQL]networkdays and business hours

2007-07-31 Thread Weston, Craig \(OFT\)
Hi there, I am trying to compute "cycle time" between two dates in mysql. This is a measurement of business hours between two datetimes, in hours. In Excel, I can use the "networkdays" function to get partway there. What I am trying to calculate is: # hours between start time and resolved time,

Cross referenced tables

2007-07-25 Thread Weston, Craig \(OFT\)
Hi there, I have a situation where I am trying to cross reference entries based on (for example) date and cost center. So without specifying the cost center sites in advance, how could I get a table returned out of mysql like: This e-mail

RE: Query against two data types

2007-07-12 Thread Weston, Craig (OFT)
lock which could contain words within the single list. I just havent figured out how to deal with this yet. Again, I really appreciate your response previously, thank you. Regards, Craig -Original Message- From: Baron Schwartz [mailto:[EMAIL PROTECTED] Sent: Thursday, July 12, 2007 1:17

Query against two data types

2007-07-12 Thread Weston, Craig \(OFT\)
Hello all. I have a query I am tring to implement and I can't wrap my mind around it somehow. Can anyone help? . I have two tables within a database. Within the first table, I have a blob field that basically has a large amount of text. Within the second table, I have a list of st