Simple Query Question

2012-04-14 Thread Willy Mularto
Hi,
Please help what is wrong with this simple query SELECT COUNT(key_agent) total 
FROM agents_consolidated  WHERE total = 180
Thanks.



Willy Mularto
F300HD+MR18DE (NLC1725)











Re: Simple Query Question

2012-04-14 Thread Stefan Kuhn
On Saturday 14 April 2012 09:51:11 Willy Mularto wrote:
 Hi,
 Please help what is wrong with this simple query SELECT COUNT(key_agent)
 total FROM agents_consolidated  WHERE total = 180 Thanks.
You need to use having instead of where, see the documentation.
Stefan



 Willy Mularto
 F300HD+MR18DE (NLC1725)



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



Re: Simple Query Question

2012-04-14 Thread Willy Mularto
Hi many thanks for the help :)



On Apr 14, 2012, at 6:21 PM, Stefan Kuhn wrote:

 On Saturday 14 April 2012 09:51:11 Willy Mularto wrote:
 Hi,
 Please help what is wrong with this simple query SELECT COUNT(key_agent)
 total FROM agents_consolidated  WHERE total = 180 Thanks.
 You need to use having instead of where, see the documentation.
 Stefan
 
 
 
 Willy Mularto
 F300HD+MR18DE (NLC1725)
 
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql
 

Willy Mularto
F300HD+MR18DE (NLC1725)










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



Fw: Simple Query Question

2012-04-14 Thread Abhishek Choudhary


Hi ,
count() function is a group function so use group by clause  in your select 
statement if you are selecting more than one column data..

here is some sample query related to help you,

select count(*)   from trndisburse:

output:1467

select count(*),pkdisburseid from trndisburse_TMP m Group by
 pkdisburseid;

output:
COUNT(*)PKDISBURSEID

100011120414090807001226
100011120414090807001228
100011120414090807001246
100011120414090807001252
100011120414090807001173
100011120414090807001187
100011120414090807001230
100011120414090807000859
10001112041409080742
10001112041409080751
10001112041409080797
100011120414090807001309
100011120414090807001314
100011120414090807001333
100011120414090807001290
10001112041409
080701
..
..some more  data...

last equivlent to your  problem:

select count(pkdisburseid) from trndisburse_TMP m
where grossamt=6000
  Group by pkdisburseid;

select count(pkdisburseid),grossamt from trndisburse_TMP m
where grossamt=6000
  Group by pkdisburseid,grossamt;

Thanks ,
abhisehk choudhary
www.tech4urhelp.blogspot.com



 From: Stefan Kuhn stef...@web.de
To: mysql@lists.mysql.com 
Sent: Saturday, 14 April 2012 4:51 PM
Subject: Re: Simple Query Question
 
On Saturday 14 April 2012 09:51:11 Willy Mularto wrote:
 Hi,
 Please help what is wrong with this simple query SELECT COUNT(key_agent)
 total FROM agents_consolidated  WHERE total = 180 Thanks.
You need to use having instead of where, see the documentation.
Stefan



 Willy Mularto
 F300HD+MR18DE (NLC1725)



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

Re: Shared memory protocol can not be accessed in windows

2012-04-14 Thread Claudio Nanni
Red carpet for you Using shared memory! last one was Monty while
developing MySQL 3.x!!!

Sorry Siva,
A bit of fun about MySQL on windows shared-memory protocol :)

I have no experience on Shared Memory protocol and as me I think 99.999% of
MySQL users.
I think it would be way more appropriate to use TCP/IP so that (1) you can
migrate to Linux/Mac anytime hassle-free (2) find a zillion people ready to
help you.

If you still want to be helped with this protocol please provide:

MySQL Version
my.ini
mysql full configuration report (you may use  mysql -h127.0.0.1 -P3306
-uroot -e show variablesthis will work if no root password is set,
otherwise add the -p parameter)


Thanks!

Claudio

2012/4/14 SIVASUTHAN NADARAJAH nsivasut...@live.com





 I used windows 7 OS. I try to connect to the MySQL server locally using
 shared memory prtotocolthis error message comes. Any one, can you tell me
 how to figure out this? C:\mysql -h localhost -u root --protocol=memory
 --enable-shared-memory -p
 Enter password: 
 ERROR 2038 (HY000): Can't open shared memory; client could not create
 request event (2)C:\  Also I am unable to use nt-pipe protocol.C:\mysql
 -h localhost -u root --protocol=pipe --enable-named-pipe  -p
 mysql: unknown option '--enable-named-pipe'C:\ Thanks.Sivasuthan.





-- 
Claudio