Home > database >  Mysql query result is empty, display the values in the query conditions
Mysql query result is empty, display the values in the query conditions

Time:10-06

Do the background data statistical time separate statistical results of output

Use select count (*) as the sum of the time the from track where time=123456789 or time=987654321 query, if there is no time for the specified value in the table when it returns null, how to make the return value in the query conditions, such as allowing the display as follows:

The sum time
0, 123456789
0, 987654321
X...

Rather than

Sun time
0 NULL

Beg ace `

CodePudding user response:

 select count (*) as the sum, b.t ime from tracka, (
Select 123456789 as time union all select 987654321
(b) where a.t ime=b.t ime
Group by b.t ime

CodePudding user response:

Suggest you list your table structure, and provide the test data, and based on these test data that corresponds to the correct result,
Refer to the way the post questions http://bbs.csdn.net/topics/320211382

1. You create table XXX.. Statement
2. You insert into XXX... Statement
3. The result is what kind, and give a simple algorithm description)
4. Do you use the database name and version of (often asked in MS SQL server edition MySQL)

So people who want to help you to build the same environment with you directly, and in providing the test before, avoid the error in the text understanding,

CodePudding user response:

Junction post rate: 0%

When you the solutions of the problems please post.
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html

8, how to give points and knot stick?
http://bbs.csdn.net/help#post_dispose
  • Related