By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,496 Members | 1,528 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,496 IT Pros & Developers. It's quick & easy.

Output query in MySQL

P: 66
Hello everyone.

I have this query and this output:

Expand|Select|Wrap|Line Numbers
  1. SELECT * , 
  2. COUNT(STATE) AS strSTATE, 
  3. COUNT(TYPESTATE) AS strTYPESTATE 
  4. FROM 
  5. tbl_MYSQL 
  6. WHERE STATE = 'ABSENT' 
  7. AND DATE = '2008-04-29' 
  8. GROUP BY STATE, 
  9. TYPESTATE, 
  10. DESCR 
  11. ORDER BY DESCR ASC 
  12.  
[HTML]
AAA BBB-ZONE CA 9168381000 Expectancy 1 29/04/2008
AAA BBB-ZO CA-UOD MONTAG-1 9168381620 Disease 1 29/04/2008
AAA BBB-ZO CA-UOD MONTAG-9 9168381629 Holiday 1 29/04/2008
AAA BBB-ZO CA-UOD DIENSTAG 9168381650 Permit 1 29/04/2008
AAA BBB-ZO CA-UOD DIENSTAG 9168381650 Holiday 1 29/04/2008[/HTML]

To have this output?
Can you help me?

[HTML]
AAA BBB-ZONE CA 9168381000 Expectancy 1 29/04/2008
Disease 1 29/04/2008
Holiday 1 29/04/2008
Permit 1 29/04/2008
Holiday 1 29/04/2008[/HTML]
Apr 29 '08 #1
Share this Question
Share on Google+
6 Replies


mwasif
Expert 100+
P: 801
You can not get such output using only MySQL. You can get such format with the combination of MySQL and PHP/ASP.
Apr 30 '08 #2

P: 66
You can not get such output using only MySQL. You can get such format with the combination of MySQL and PHP/ASP.
Thanks x your reply, but one example ?
Apr 30 '08 #3

P: 91
what programming language are you using or are you just querying the database through the CMD prompt or GUI?
Apr 30 '08 #4

P: 66
what programming language are you using or are you just querying the database through the CMD prompt or GUI?
thanks, I use language ASP.
May 1 '08 #5

P: 91
thanks, I use language ASP.
I'm not familiar with ASP but basically what you would do is send the query then fetch the results. Then use a while loop to go through each row returned and get the data you want from it.
May 1 '08 #6

P: 66
I'm not familiar with ASP but basically what you would do is send the query then fetch the results. Then use a while loop to go through each row returned and get the data you want from it.
Ok, I understand...

Can I have the same query this output ( I add Total Rows and Total Columns... ) : ?

Expand|Select|Wrap|Line Numbers
  1. ID_DESCRIPTION     Expectancy    Disease    Holiday   Permit  DATE       TOTAL
  2. 10                 1             1          2         1       29/04/2008     5
  3. 11                 2             0          2         3       29/04/2008     7
  4. Total              3             1          4         4       29/04/2008     12
  5.  
  6.  
May 1 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.