RE: How to become a DBA on MySQL

2010-07-13 Thread Keith Clark
Jerry, Do you know of any reputable online classes that you could point me to? Keith On Tue, 2010-07-13 at 14:25 -0400, Jerry Schwartz wrote: > You might want to see if there are any online classes that could get you > started. I usually start by reading a big, thick book -- but I've found that

Re: WHERE clause from AS result

2010-06-10 Thread Keith Clark
You can use an Alias in ORDER BY but not in WHERE clauses. Keith On Thu, 2010-06-10 at 16:38 -0400, Steven Staples wrote: > Ok, I have done it before, where I have used the AS result in an ORDER BY, > but now, I can't figure out why I can't use it in a WHERE clause? > > SELECT `email`, (SELECT C

Re: Count Query question

2010-05-13 Thread Keith Clark
2 6 > 2010-05-10 00:00:00 2 6 > 2010-05-11 00:00:00 3 9 > 2010-05-12 00:00:00 3 9 > > One line for each day except that 2010-05-07 is missing because each product > had 0 quant

Re: Count Query question

2010-05-12 Thread Keith Clark
> > On May 12, 2010, at 3:06 PM, Keith Clark wrote: > > > On Wed, 2010-05-12 at 10:13 -0400, Keith Clark wrote: > >> Chris, > >> > >> Here is my full table definition: > >> > >> CREATE TABLE `products` ( > >> `products_id` int(15)

Re: Count Query question

2010-05-12 Thread Keith Clark
On Wed, 2010-05-12 at 10:13 -0400, Keith Clark wrote: > Chris, > > Here is my full table definition: > > CREATE TABLE `products` ( > `products_id` int(15) NOT NULL AUTO_INCREMENT, > `products_quantity` int(4) NOT NULL, > `products_model` varchar(15) NOT NULL DEFAUL

Re: Count Query question

2010-05-12 Thread Keith Clark
Chris, Here is my full table definition: CREATE TABLE `products` ( `products_id` int(15) NOT NULL AUTO_INCREMENT, `products_quantity` int(4) NOT NULL, `products_model` varchar(15) NOT NULL DEFAULT '', `products_image` varchar(64) DEFAULT NULL, `products_price` decimal(15,4) DEFAULT NULL, `p

Count Query question

2010-05-12 Thread Keith Clark
I'm trying to produce a report that will tell me how many products were available with a Quantity>0 before a certain date, and have that ordered by date. Table: Date Quantity Result desired DateQuantity Available May 1 5000 May 2 5050 May 3 5075 Thanks, Keith -- MySQL General Ma

Re: order by numeric value

2010-04-27 Thread Keith Clark
On Wed, 2010-04-28 at 08:57 +1000, Jesper Wisborg Krogh wrote: > On Wed, 28 Apr 2010 08:53:57 Keith Clark wrote: > > But I'd prefer not to see the extra sorting field. > > You don't need to select a field in order to be able to order by it. > > So > > se

RE: order by numeric value

2010-04-27 Thread Keith Clark
---+ > | 1.00 | > +---+ > 1 row in set (0.00 sec) > > > Which in that case, it's better to just select balance without the dollar > sign and order on that column.

Re: order by numeric value

2010-04-27 Thread Keith Clark
On Wed, 2010-04-28 at 00:18 +0200, Carsten Pedersen wrote: > Keith Clark skrev: > > I have the following statement: > > > > select chart_of_accounts.accountname as Account, > > concat('$',format(coalesce(sum(sales_journal_entries.debit),0),2)) as > >

order by numeric value

2010-04-27 Thread Keith Clark
I have the following statement: select chart_of_accounts.accountname as Account, concat('$',format(coalesce(sum(sales_journal_entries.debit),0),2)) as Debit, concat('$',format(coalesce(sum(sales_journal_entries.credit),0),2)) as Credit, concat('$',format(coalesce(sum(sales_journal_entries.credit),

Re: Nested inserts possible?

2010-03-12 Thread Keith Clark
Johan, That seems to be the ticket. Thanks! Keith On Fri, 2010-03-12 at 16:54 +0100, Johan De Meersman wrote: > Have a look at last_insert_id(). > > On Fri, Mar 12, 2010 at 3:48 PM, Keith Clark > wrote: > I have two tables and I have data to insert into both at the

Nested inserts possible?

2010-03-12 Thread Keith Clark
I have two tables and I have data to insert into both at the same time, but the second table depends on an ID that is auto created in the first table. I'm not sure exactly how to accomplish this. Table_One Table_One_Index_ID Data_One Date_Two Table_Two Table_Two_Index_ID Table_One_Index_ID Dat

Edit Stored Procedures

2009-12-01 Thread Keith Clark
I'm trying to edit one of my stored procedures using MySQL Query Browser and this is what I get back as a listing when I select Edit All Procedures: DROP PROCEDURE IF EXISTS `kwbo4418_2008bookworminventory`.`UpdateStock` $$ /*!50003 SET @TEMP_SQL_MODE=@@SQL_MODE, SQL_MODE='' */ $$ (null) $$ /*!500