My table have a lot of columns but only two counts for what i want to do - from the two i can get date; req (count(*), based on error code req and succ so try follow table if it distorted
time statuscode
2011-05-06 08:55:45 304
2011-05-06 22:49:13 203
2011-05-07 00:35:57 205
2011-05-07 00:36:19 204
2011-05-08 02:05:21 299
2011-05-09 02:05:21 399
2011-05-09 02:05:21 200
2011-05-09 08:55:45 204...
User Profile
Collapse
-
analytical query
Last edited by Niheel; May 17 '11, 04:24 PM. Reason: Please use complete sentences and proper spelling. "Plz" should be "Please". -
That did it - thanks a lot -
mysql - change date - update table
Hi Anyone appreciate your help,
I have a table with about 7 columns - one is a date column - I would like to update the table and change all dates starting from a certain key (the first column) from May to June - keeping the year and date just changing the month 05 to 06
note the dates are in random order -so e.g start at id 1001
col 1 (id#) col2(dates) note date format
1001 2010-05-14
1002 2010-05-08... -
php - exclude number in while loop count
how can I set variable to a number and loop count from that number to a another with exception/ != certain numbers between variable set number and max loop count number so
$x = '1'
while ($x < = 10 ) do something
but what if I want to skip say 5 , 7 & 8 in code / something that follows
how can I do this ? -
Anyone,
Trying to find out why when i made change above ( from = 'y' to == 'y' ) it skips the if solution and keep executing the else portionLeave a comment:
-
-
Why is if else statement not working
Code:<?php fwrite(STDOUT, "do you want ans in cel ? type y or N to continue \n"); //$handle = fread(STDIN, 80); $ansincel =fgets(STDIN); echo " Plz enter number \n"; //$handle1 = fread(STDIN, 80); $numdeg = fgets(STDIN); if ($ansincel = 'y') { $tc = ((5/9)*($numdeg - 32)); // convert to degrees celcius fwrite(STDOUT, " the degree in cel is $tc
-
mysql - get the percentage of a row count of all counts
Hi All , I would like to in one query from the same table of say first names count all the occurrences of the various first names in a column called thecount and create another column called percentage that give the percentage of the count of an individual of the sum of all the counts of first names so all fname sara is 10%
say select count(*) as thecount , fname, count(*)/sum(count(*)) as percentage and you get
thecount fname percentage... -
use date formats with if then else or case when
hi all any help very much appreciated
given this data - and I want to group and count all the times with in a 2 min time frames so 00:00 00:02 00:04 up to 23:58 - so all times between 00:00 and 00:01 get counted as 00:00 and for 00:02 and 00:03 as occurring at 00:02 so like 03:12 would show a count of 2 for 03:12 and 03:13
times col # time occurred
2010-02-05 00:00 5
2010-02-05 00:03 3
2010-02-05... -
convert year
per query and result below - how can I get the current year in the first column which is avg time instead of year 1900 - I get first column (avg time) as a result of query below
Thanks in advance
select dateadd(second, datediff(second ,startTIME,endT IME)/2,120) as avg time ,startTIME,endT IME
From table
Where (startTIME >= '2010-02-01 00:00:00') and (endTIME <= '2010-02-01 00:59:59')
group by... -
CK , anyone - I think I can figure out a way to solve query first part - but can you help me on the second part - so I need the top say 10 or whatever results for Fri Sat and Sun - each day - not the over all top 10 for all three days combined which means Sat could have seven out of the ten - need 10 for Fri , 10 for Sat, 10 for SunLeave a comment:
-
-
tough going with group to get result
Hi Anyone - need your help
i would like a query to list two main columns Atime and endtime - query to group the start times and endtime separately - even though the table start out with corresponding start time and end times. table is thousand of lines vary times
Also would like to get say the top times of each Fri Sat Sun of each week in each month over a period of time say 3 months
so for example - first week end in Feb, table... -
MSSQL help using date function - to get peak range of ATIME and EndTime
Hi anyone - appreciate any help
I would like to get * one column * with that min of the day instead of hr and min separately
So the first line for example 18:50 pm would be the 1130 min of the day
And if it was 6:50 am would be 410 min of a day
What is the best function I can use in my select statement to get this and be able to group by it ?
select datepart(yyyy,A TIME)as yr, datepart(mm,ATI ME)as... -
why no result from temprature function
Hi
Appreciate any help - why not getting any result from either print statement for celcius of farenheit
Code:import re import os import string import sys def tempconvert(): c = "" f = "" print 'this program converts celcius to farenheit and visa versa' temp = raw_input ("enter f if you want Faren or c if you want celcius")
-
first field criteria to new file
need to break out a file into three separate files based on first field e.g.
file = ['aaa sfsfs sfsdfs sdfes'
aaa srgfr grg ht hrhr
aaa egero eriore erore',
hh dsrgr rger ergerl rr
hh oefsrf werf ewf wfre,
k efwgwe wfwer fwe fwetf,
ddd fsff rgferw grwr
ddd wfrewe gptrg rer
ddd eortwer writwer erwo,... -
maintain lines and space after sort
how do I keep my file as is after a sort - it is jumbled with \t tabs and \n newlines
ran this script
af = open('c:\Docume nts and Settings\Admini strator\Desktop \pm2.txt', 'r')
keyfld = [item for item in af]
keyfld.sort()
print keyfld
on this file
00000047f36d014 afe88 12/14/2008 10:48:53 PM Deleted session ID 00000047f36d014 afe88 due to server request|
00000047f36d014 afe88... -
BV - awsome stuff
appreciate all the reply
Thanks again for your helpLeave a comment:
-
mysql and dictionary
bvdet
appreciate the reply - lots of good , new stuff
I am trying to disect your answer and understand every step but can you breifly explain 1. look like you are using i and ip 2 variables in your for loop to rep and loop thru each value in ip_array ?
and 2. dd[dept_array[i]] = (ip_array[i], ping_result) - are you assigning values ip_array[ i] and ping_result value to dd key dept_arr...Leave a comment:
-
micmast
This seems like the lead I am looking for , let me try it
TY .. will le u knoLeave a comment:
No activity results to display
Show More
Leave a comment: