473,508 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Output query in MySQL

66 New Member
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
6 1795
mwasif
802 Recognized Expert Contributor
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
Mike1961
66 New Member
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
arggg
91 New Member
what programming language are you using or are you just querying the database through the CMD prompt or GUI?
Apr 30 '08 #4
Mike1961
66 New Member
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
arggg
91 New Member
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
Mike1961
66 New Member
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

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

Similar topics

2
7375
by: Martin Foster | last post by:
Hi. I want to do something really simple. I want to be able to write a custom SQL query in a textbox on a webpage, submit it and then output to the webpage in the format of MySQL output i.e....
2
10629
by: Galina | last post by:
Hello I need to get data from 4 Oracle tables and combine them into a temporary table in my application. I get data using a pass-through query dynamically created in code: mySQL = "SELECT...
2
1316
by: Bob Sanderson | last post by:
I have a search form from which I hope to be able to select a record by field JobNumber and display it with an output form titled test.php <html> <head> <title>Job Database Search</title>...
4
1575
by: Bob Bedford | last post by:
Hello, I've a file wich must answer a request. For this my file must generate an XML output. That's work fine but sometimes I get a wrong mysql query. In this case, I've to manage the output...
0
19251
by: IamtheEvster | last post by:
Hi All, I am currently using PHP 5 and MySQL 5, both on Fedora Core 5. I am unable to call a MySQL stored procedure that returns output parameters using mysql, mysqli, or PDO. I'm having a...
2
2511
by: hph | last post by:
A bunch of small things are frustrating me in trying to do some simple stuff with MySQL and php. For example, I have am trying to sum the data in a particular field, then output the result. ...
0
1123
by: PW | last post by:
I am trying to create a crosstab report in ASP. I'm using ASP/VBScript and Access database. I used Access to create the SQL query, then copied the SQL and embedded it in my ASP like this ... ...
3
1660
uranuskid
by: uranuskid | last post by:
Hey folks, Today I'm after a solution for a pretty simple problem, however, too hard for me to solve. I've got a MySQL query that reveals a table output. But if there is no result it is displaiing...
6
1560
by: jfizer | last post by:
I'm trying to print out a table of mySQL data as XML. However, the performance I'm getting is REALY bad. Adding the header("Content-Type: $mime;charset=$charset"); statement triples the load time...
1
1924
by: runsun | last post by:
I am new in PHP/Mysql. I want to input sth from website to mysql, then output the formatted data to .txt, and finally use Excel to open the .txt file. I believe there are better and simpler ways than...
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.