Sponsored Content
Full Discussion: mysql query help
Top Forums Web Development mysql query help Post 302511391 by mogabr on Wednesday 6th of April 2011 05:38:09 PM
Old 04-06-2011
i have tried timediff() , datediff(), to_days(), timestampdiff()
all doesnt show what i want , i wand the difference how many days and hours:min

so i can update another column with these values

---------- Post updated at 02:38 PM ---------- Previous update was at 02:29 PM ----------

Quote:
Originally Posted by Corona688
What have you tried?

i have tried timediff() , datediff(), to_days(), timestampdiff()
all doesnt show what i want , i wand the difference how many days and hours:min

so i can update another column with these values
Image
 

8 More Discussions You Might Find Interesting

1. Programming

How to query one to many mysql

Hi there, I have a hierarchical database that include 4 tables. Table A is the parent of B, B is Parent of C, C is parent of D. If I want to query everything in D that is associated with A.name, how do I do that? Thanks! YanYan (0 Replies)
Discussion started by: pinkgladiator
0 Replies

2. Shell Programming and Scripting

? parameter in mysql query

I am debugging some code and came across ? in the WHERE cause in a mysql query. Is this possible and what situations would this be used? SELECT ip, count FROM table WHERE domain=? thanks & regards (2 Replies)
Discussion started by: hazno
2 Replies

3. Shell Programming and Scripting

mysql help : query with 2 conditionals

Hi there, I have a table that stores multiple records for many different servers, each of which is timestamped ... I wanted to write a query that would enable me to only output the "latest" record (based on timestamp) for each "unique" server. So for example my main table looks like this ... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

4. Shell Programming and Scripting

mysql query in shellscript

Hi, I want to access mysql query from database , for that i have tried the below code #! /bin/bash TABLE_NAME=database1 USER_NAME=root IP_ADDR=111.20.9.256 somevar=`echo "select altid from alert where altid='2724'"| mysql -h $IP_ADDR -u $USER_NAME $TABLE_NAME ` echo $somevar ... (1 Reply)
Discussion started by: aish11
1 Replies

5. Shell Programming and Scripting

mysql query in shellscript

Hi, I want to run below query on shellscript but having one problm. ADV=$( mysql -h "$IP_ADDR" -u "$USER_NAME" "$TABLE_NAME" -BNe" SELECT ADV FROM indata where inid='$INSTRUID' and Date='$latest Date';" ) here Date column contans different below dates 2011-12-01... (11 Replies)
Discussion started by: aish11
11 Replies

6. Programming

mysql query help

Hello i have created mysql query to compare to values and get difference in percentage as following: SELECT file_name, 100 - ((100 * (SELECT file_count FROM xipi_files z WHERE x.file_group = z.file_group AND x.file_name = z.file_name AND z.insert_date = CURDATE( ) - INTERVAL 1 DAY)) /... (1 Reply)
Discussion started by: mogabr
1 Replies

7. Programming

Need help in mysql query

Hi All, i have a table in mysql with the following data Table name Test Assettype Serial_No Status location Mouse 123456 In Stock chennai Mouse 98765 Allocated chennai Keyboard ... (2 Replies)
Discussion started by: venkitesh
2 Replies

8. Shell Programming and Scripting

Need wrapper around mysql query

Hello Friends, I am using check_mysql_query plugin in nagios to query database and get output. query is working fine but output which i am getting contain query. I want to remove query from output and give custom message which will be simple and understandable. Can you help me here with any... (5 Replies)
Discussion started by: ghpradeep
5 Replies
VNSTATI(1)							   User Manuals 							VNSTATI(1)

NAME
vnStati - png image output support for vnStat SYNOPSIS
vnstati [ -cdhimostv? ] [ --cache time ] [ --config file ] [ --days ] [ --dbdir directory ] [ --help ] [ --hours ] [ -hs ] [ --hsummary ] [ -i interface ] [ --iface interface ] [ --locale locale ] [ --months ] [ -ne ] [ -nh ] [ --noedge ] [ --noheader ] [ --output file ] [ -ru ] [ --rateunit ] [ --style number ] [ --summary ] [ --top10 ] [ --transparent ] [ --version ] [ -vs ] [ --vsummary ] DESCRIPTION
The purpose of vnstati is to provide image output support for statistics collected using vnstat(1). The image file format is limited to png. All basic outputs of vnStat are supported excluding live traffic features. The image can be outputted either to a file or to standard output. OPTIONS
-c, --cache time Update output file only if at least time minutes have passed since the previous file update. This option is ignored if stdout is used as output. --config file Use file as config file instead of using normal config file search function. -d, --days Output traffic for days. --dbdir directory Use directory as database directory instead of using the directory specified in the configuration file or the hardcoded default if no configuration file is available. -h, --hours Output traffic for the last 24 hours. -hs, --hsummary Output traffic summary including hourly data using a horizontal layout. -i, --iface interface Use interface instead of default or configured interface. --locale locale Use locale instead of using the locale setting specified in the configuration file or the system default if no configuration file is available. -m, --months Output traffic for months. -ne, --noedge Remove darker edges from around the image. -nh, --noheader Remove header containing title and update time. Time of the previous update will still be visible in the lower right corner using a less visible color. -o, --output file Write png image to file and exit. Output can be directed to stdout by giving "-" as filename. -ru, --rateunit Swap the configured rate unit. If rate has been configured to be shown in bytes then rate will be shown in bits if this option is present. In the same way, if rate has been configured to be shown in bits then rate will be shown in bytes when this option is present. Alternatively 0 or 1 can be given as parameter for this option in order to select between bytes (0) and bits (1) regardless of the configuration file setting. --style number Modify the content and style of outputs. Setting number to 3 will show average traffic rate in all outputs where it is supported. Other values will show bar graphics instead. -s, --summary Output traffic summary. -t, --top10 Output all time top10 traffic days. --transparent Toggle background color transparency depending of the TransparentBg setting in the configuration file. Alternatively 0 or 1 can be given as parameter for this option in order to either disable (0) or enable (1) transparency regardless of the configuration file setting. -v, --version Show current version. -vs, --vsummary Output traffic summary including hourly data using a vertical layout. -?, --help Show a command summary. FILES
/var/lib/vnstat/ Default database directory. Files are named according to the monitored interfaces. /etc/vnstat.conf Config file that will be used unless $HOME/.vnstatrc exists. See vnstat.conf(5) for more information. EXAMPLES
vnstati -s -i eth0 -o /tmp/vnstat.png Output traffic summary for interface eth0 to file /tmp/vnstat.png. vnstati -vs -i eth0+eth1+eth2 -o /tmp/vnstat.png Output traffic summary with hourly data under the normal summary for a merge of interfaces eth0, eth1 and eth2 to file /tmp/vnstat.png. vnstati -h -c 15 -o /tmp/vnstat_h.png Output hourly traffic statistics for default interface to file /tmp/vnstat_h.png if the file has not been updated within the last 15 minutes. vnstati -d -ne -nh -o - Output daily traffic statistics without displaying the header section and edges for default interface to standard output (stdout). vnstati -m --config /home/me/vnstat.cfg -i -o - Output monthly traffic statistics for default interface specified in configuration file /home/me/vnstat.cfg to standard output (std- out). AUTHOR
Teemu Toivola <tst at iki dot fi> SEE ALSO
vnstat(1), vnstatd(1), vnstat.conf(5), units(7) version 1.11 JUNE 2011 VNSTATI(1)
All times are GMT -4. The time now is 03:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy