RE: trouble with perl

2012-08-08 Thread DaWiz
I can't find his phone number to call him.

-Original Message-
From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: Wednesday, August 08, 2012 12:22 PM
To: elim@gmail.com
Cc: mysql@lists.mysql.com
Subject: RE: trouble with perl


I know I had the same problem with PHP when mysql.dll was off my PATH..put
the 2 mysql libraries on the first directory from your PATH

05/30/2008  08:17 PM 2,125,824 libmysql.dll
06/13/2012  06:31 PM34,304 php_mysql.dll

be aware when things go wrong with DLL's you have no way to fix it except
1)grab the source
2)build it ..usually thru .\configure then .\make install
3)make sure the new binary gets installed to the first directory on your
PATH

Viel Gluck,
Martin 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
dient lediglich dem Austausch von Informationen und entfaltet keine
rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire
informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
de ceci est interdite. Ce message sert à l'information seulement et n'aura
pas n'importe quel effet légalement obligatoire. Étant donné que les email
peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
aucune responsabilité pour le contenu fourni.


 Date: Wed, 8 Aug 2012 13:28:42 -0400
 Subject: Re: trouble with perl
 From: per...@elem.com
 To: elim@gmail.com
 CC: mysql@lists.mysql.com
 
 On Wed, Aug 8, 2012 at 1:12 PM, Elim Qiu elim@gmail.com wrote:
  But when I use browser for the system testing (perl_test.cgi and
forum.pl),
  both report me that DBD:mysql is not installed (or not available)
 
 It's possible that DBD::mysql is installed in a place where it's not
 in the library path for your CGI script, or that you have more than
 one Perl installed on your system.
 
 I'd suggest you get some help either from the group that makes mwforum
 or on the Perl Beginner's list, since this is not a MySQL issue.  The
 Perl Beginners list is here: http://lists.perl.org/list/beginners.html
 
 - Perrin
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql
 
  


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: order by numeric value

2010-04-27 Thread DaWiz

Try

order by CAST(Balance as decimal(8,2)) asc;


Cast will work in the order by.

Glenn Vaughn

- Original Message - 
From: Keith Clark keithcl...@k-wbookworm.com

To: mysql@lists.mysql.com
Sent: Tuesday, April 27, 2010 3:52 PM
Subject: order by numeric value



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),0)-coalesce(sum(sales_journal_entries.debit),0),2)) 
as Balance

from sales_journal_entries
left join sales_journal
on sales_journal.journalID=sales_journal_entries.journalID
left join chart_of_accounts
on chart_of_accounts.accountID=sales_journal_entries.accountID
where sales_journal.date  '2008-12-31'
and sales_journal.date  '2010-01-01'
group by sales_journal_entries.accountID
order by Balance asc;

and I'd like the output to be sorted by the Balance according to the
numberic value, but it is sorting by the string result.  I tried
abs(Balance) but I get the following error:

1247 Reference 'Balance' not supported (reference to group function)

I'm not sure I understand the error.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=my...@dawiz.net 


smime.p7s
Description: S/MIME cryptographic signature


Re: Weeks

2009-12-29 Thread DaWiz

If all you want is the current week then the query is simple:

SELECT * FROM orders where WEEK(orders.order_date) = WEEK(NOW())

The default is thje day starts on Sunday so the second value is not needed. 
WEEK(NOW(),7) is equivalent to WEEK(NOW(),0) - the valid values are 0 - 6.


As for performance, I tested the query against a table I have with 199,826 
rows - it returned the data in 0.016 seconds (selecting distinct week(date)) 
and selecting * returned 3,816 rows in 0.827 seconds.


One concern will be when the data spans years - in that case you will need 
to also check for year:


SELECT * FROM orders where WEEK(orders.date) = WEEK(NOW()) and 
YEAR(orders.order_date) = YEAR(NOW())



- Original Message - 
From: ML mailingli...@mailnewsrss.com

To: mysql@lists.mysql.com
Sent: Monday, December 28, 2009 5:14 PM
Subject: Weeks



Hi All,

trying to write some SQL that will give me records for the CURRENT WEEK.

Example, starting on a Sunday and going through Saturday.
This week it would be Dec 27 - Jan 2.

I am doing this so I can write a query that will show orders that are 
placed during the current week.


Here is what I have, but this is showing from today for the next seven 
days.


SELECT * FROM orders WHERE WEEK(NOW(), 7) = WEEK(orders.order_date, 7)
AND DATEDIFF(NOW(),orders.order_date)  7;

Would anyone have any advice?

-Jason


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=my...@dawiz.net




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Is there a better way than this?

2009-12-28 Thread DaWiz

This will work:

select distinct X from a as a
where Y in(25)
and
not exists (select X from a as b where a.X = b.X and b.Y in(24))


- Original Message - 
From: Tim Molter tim.mol...@gmail.com

To: mysql@lists.mysql.com
Sent: Sunday, December 27, 2009 4:04 PM
Subject: Is there a better way than this?



I'm new to MySQL and I'm looking for some guidance. I have a table A,
with two columns X and Y with the following data:

|   X|Y|
   1  24
   1  25
   2  25
   2  26
   3  27

I want my SQL query to return 2 following this verbose logic: SELECT
DISTINCT X FROM A WHERE Y equals 25 and Y also does NOT equal 24.

I came up with the following SQL, which gives me my desired result,
but is there a better way to do it? Can it be achieved using MINUS or
UNION somehow?

BTW, I'm using IN here because I intend to replace the single numbers
(24 and 25) with arrays that have 0 to N members.

SELECT DISTINCT X FROM `A`

WHERE X IN (
SELECT X FROM `A` WHERE Y IN (25)
)

AND X NOT IN (
SELECT X FROM `A` WHERE Y IN (24)
)

Thanks!

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=my...@dawiz.net


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Query help

2009-12-13 Thread DaWiz
SELECT count(distinct trans_no) from SEARCHES WHERE comp_id=675 and 
result='o';


- Original Message - 
From: Richard Reina rich...@rushlogistics.com

To: mysql@lists.mysql.com
Cc: rich...@rushlogistics.com
Sent: Sunday, December 13, 2009 11:36 AM
Subject: Query help


I was wondering if someone could lend a hand with the following query.  I 
have table.


SEARCHES
|ID |trans_no|comp_id|result
13  | 455|  675| o
15  | 302|  675| o
16  | 455|  675| o
12  | 225|  629| y

SELECT count(*) FROM SEARCHES WHERE comp_id=675 AND result='o' GROUP BY 
trans_no;


gives me a count of 3.

However, what I need is a count for how many different (unique) 
transactions company number 675 got a result 'o' which would be 2 (455  
302).  I have tried different group by columns but to no avail. Can 
someone help?


Thanks,

Richard

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=my...@dawiz.net




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Distinct max() and separate unique value

2009-10-20 Thread DaWiz

I would try:

select max(object_id), term_taxonomy_id
group by term_taxonomy_id
order by term_taxonomy_id;

max(column) returns a single value so distinct is not needed.
The group by and order by should only have columns thaqt are displayed and 
that are not aggregate columns.


- Original Message - 
From: Eric Anderson e...@macandbumble.com

To: mysql@lists.mysql.com
Sent: Tuesday, October 20, 2009 3:42 PM
Subject: Distinct max() and separate unique value




I'm trying to formulate a query on a Wordpress database that will give me 
the highest 'object_id' with the highest 'term_taxonomy_id', something 
like:


+-+--+
| max(distinct object_id) | term_taxonomy_id |
+-+--+
|1503 |  127 |
|1494 |  122 |
+-+--+

But I just can't seem to get there?

select max(distinct object_id), term_taxonomy_id from 
wp_term_relationships where term_taxonomy_id IN (122,127) group by 
term_taxonomy_id, object_id order by term_taxonomy_id desc, object_id desc


+-+--+
| max(distinct object_id) | term_taxonomy_id |
+-+--+
|1503 |  127 |
|1481 |  127 |
| 300 |  127 |
|1503 |  122 |
|1494 |  122 |
|1470 |  122 |
|1468 |  122 |
|1205 |  122 |
|1062 |  122 |
| 316 |  122 |
| 306 |  122 |
| 228 |  122 |
| 222 |  122 |
| 216 |  122 |
| 211 |  122 |
| 184 |  122 |
| 155 |  122 |
| 149 |  122 |
| 134 |  122 |
| 128 |  122 |
| 124 |  122 |
| 119 |  122 |
| 113 |  122 |
| 109 |  122 |
| 105 |  122 |
|  93 |  122 |
|  91 |  122 |
|  87 |  122 |
+-+--+

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=my...@dawiz.net 



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Distinct max() and separate unique value

2009-10-20 Thread DaWiz


- Original Message - 
From: Eric Anderson ke...@on-e.com

To: mysql@lists.mysql.com
Sent: Tuesday, October 20, 2009 4:05 PM
Subject: Re: Distinct max() and separate unique value
I'm trying to formulate a query on a Wordpress database that will give 
me the highest 'object_id' with the highest 'term_taxonomy_id', 
something like:


+-+--+
| max(distinct object_id) | term_taxonomy_id |
+-+--+
|1503 |  127 |
|1494 |  122 |
+-+--+

But I just can't seem to get there?


I confess I did not understand what you are trying to do.

If what you actually want is the highest 'term_taxonomy_id' for each 
distinct objhect_id then the query would be:


select object_id, max(term_taxonomy_id)
where term_taxonomy_id IN (122,127)group by object_id
order by object_id desc;

This query will not take into consideration term_taxonomy_Id values other 
than 122 and 127, it also will not return object_id's without a 
term_taxonomy_Id value of 122 or 127.






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Fw: Weird problem with mysql_query

2008-09-10 Thread DaWiz





- Original Message - 
From: Darryle Steplight [EMAIL PROTECTED]

To: MySql [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Sent: Tuesday, September 09, 2008 6:59 PM
Subject: Re: Weird problem with mysql_query



Hi G,
  There is nothing weird about your results. When you do a Count(*)
without a GROUP BY(someColumn) you are essentially asking MySQL how
many rows are present in the table. But when you do use Group By
someColum , you are asking MySql how many  rows do I have of
someColumn .  It's just a good practice to use GROUP BY when you
want to a count of a specific column .

mysql select count(*) as 'Count' from logins GROUP BY dawiz


I found my problem - it turned out to be a misconception on my part; I was
using sprintf(buf,%d, row[i]) if it was a numeric field - this was
printing the address rather than the value.  Apparently even though the 
data

is type MYSQL_TYPE_LONGLONG it should be treated as char.

G Vaughn


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]