#mysql
02 October 2007
Total 26 pages. You are browsing page 2/26.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
01:04 <****> that just sounds icky
01:04 <****> well, they could overlap, so you can't just toal the count if you split into separate tables
01:04 <****> put them in one table and unique the date
01:04 <****> or don't and select distinct date
01:04 <****> dkr date_diff - count on table1 - count on table 2
01:04 <****> yeah, this is something best left to application code, probably. :)
01:05 <****> yes not much of a rdbms thing
01:05 <****> progzy: what if holiday falls on a weekend?
01:05 <****> mysql_num_rows('SELECT `name` FROM `people` WHERE name="'.$broker.'" AND title="Broker" LIMIT 1'); returns Unknown column 'Broker' in 'field list'. What does that mean?
01:05 <****> yes :)
01:05 <****> There a problm with that dkr
01:05 <****> progzy: yes, you'd subtract it twice
01:06 <****> yes that is the problem
01:06 <****> So one table is required
01:07 <****> I have annual date (anniversary for instance) .. (flagged in the table, faked year) Is there a way to work with it ?
01:08 <****> 1/1/2000 is always holiday like the 1/12001 etc ...
01:10 <****> dkr : is a union could resolve the problem for separating week ends table and holidays ?
01:11 <****> *holidays table
01:11 <****> is there anyway to get the time of the last query?
01:12 <****> w/ mysqli preferably
01:15 <****> progzy: if you were going to union them every time you might as well store them together.
01:15 <****> huhu
01:15 * thumbs smashes chadmaynard
01:15 <****> thumbs: can't you just say hello? You smash me every time I see you.
01:16 <****> sorry, hi, how are you?
01:16 <****> thumbs: Great thanks for asking. Yourself?
01:16 <****> its awkward having big thumbs. he is doing his best
01:16 <****> I don't have any social skills, I can't help it.
01:16 <****> thumbs: appreciate the effort
01:16 <****> yes, I meant to hug you, but I smashed you instead.
01:16 <****> hehe
01:16 <****> heh
01:16 <****> guess what time it is
01:17 <****> time to eat?
01:17 <****> time to go home!!!!
01:17 <****> hello?
01:17 <****> :-)
01:17 <****> good morning?
01:17 <****> blobaugh|sp: what are you still doing here? go home already!
01:18 * blobaugh|sp leaves
01:18 <****> progzy: It's not really an uncommon request in business type applications. Remember, some businesses use a 4 day work week... or allow shifts over all 7 days. So it's not always appropriate to fix the work days to Monday through Friday (minus holidays).
01:18 <****> i have a table with entries. i would like show how much hours i have. the entries r in secondes
01:19 <****> 8099
01:19 <****> ThoMe: divide sum by 3600
01:19 <****> and i would like 02:24:09
01:19 <****> is it posible?
01:19 <****> !man date and time fun
01:19 <****> see http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
01:19 <****> i have trys: SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(`duration`))) AS dauer FROM cdr;
01:19 <****> but the result are: 01:20:50
01:19 <****> its wrong
01:20 <****> 8099 / 3600 = 2,2497222222222222222222222222222
01:20 <****> and now 01:20:50
01:20 <****> what is wrong at my select?
01:20 <****> progzy: It really depends on your requirements whether storing weekends and holidays in the database to be able to filter them from business days.
01:20 <****> chadmaynard : I would use another table because i count Week ends in another part of the application with PHP
01:20 <****> Xgc: hello. do u have a idea?
01:20 <****> progzy: ... is a good idea or not.
01:20 <****> and holidays with the holidays table
01:21 <****> is there a lock-timeout variable I can set? it seems like queries against a locked table will sit forever
01:21 <****> ThoMe: select sec_to_time(8099) returns 02:14:59
01:21 <****> progzy: I don't see the need to treat holidays separately from weekends. You could handle them in a common way.
01:22 <****> progzy: At least for this purpose.
01:22 <****> | 02:14:59 |
01:22 <****> chadmaynard: i have tried:
01:22 <****> SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(`duration`)))
01:22 <****> what's a query that would take a long time? Like a loop or something? SLEEP() or something of the sort?
01:22 <****> Xgc : thanks . So you would put into the same table all week ends and holidays from 200 to 2100 ?
01:22 <****> chadmaynard: thank you very much!
01:22 <****> progzy: Weekends are pretty easy to recognize.
01:22 <****> *2000 (year)
01:23 <****> O10xzz: why would you sleep in mysql?
01:23 <****> I'm testing a script I wrote in PHP
01:23 <****> just making sure it's working
01:23 <****> progzy: There are a few ways to handle it. But you could do that. Sure.
01:23 <****> I want to have long queries
01:23 <****> is there a hack to do this?
01:23 <****> O10xzz: use left joins, unions, likewise comparisons
01:24 <****> Xgc : few ways ? What are these few ways ?
01:24 <****> or full outer joins, too
01:24 <****> SELECT SLEEP(3);
01:24 <****> found it
01:24 <****> can't you simply sleep within php?
01:25 <****> yes
01:25 <****> but it's not the same
01:25 <****> how so?
01:25 <****> I onder what would be the aim to sleep ...
01:25 <****> *wonder
01:25 <****> progzy: to recover energy
01:25 <****> :)
01:26 <****> thumbs: He wants to SELECT SLEEP(big_number) and tell his boss he is waiting on a query to finish before he can get back to work.
01:26 <****> progzy: It's an opportunity to get bonuses, when you solve that big slowdown problem in 2 or 3 months.
01:27 <****> chadmaynard: sounds like what a lzy person would do.
01:29 <****> Xgc : for the holidays problem .. as you sais it was not uncommon .. How did you solve it ? Everything in the same table from a year to another (populated with a script server ...) ?
01:29 <****> * as you said
01:29 <****> progzy: It depends on how you plan to use the data. If you're simply counting weekends, you have very simple ways to calculate how many are between x and y.
01:30 <****> ENUM is stored as INTEGER, right?
01:30 <****> progzy: If you're counting weekend-days, that's likewise easy to calculate.
01:30 <****> Only it has an "interface" with strings?
01:31 <****> Xgc : can you tell me how you can calculate Week ends between 2 dates with a SQL query ?
Total 26 pages. You are browsing page 2/26.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
