Home Page   #c  #ruby-lang  #cisco  #mysql  #apache  #javascript  #java  #perl  #php  #openmoko   Wallpapers Girl
Reliable $1 Web Hosting by 3iX

Channels


#mysql

10 October 2007


Total 18 pages. You are browsing page 2/18.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last

02:56 <****> a bit like bits
02:56 <****> dools, that'll work, but need a GROUP BY
02:57 <****> Mrdini: if i do GROUP BY id then the count is 1
02:57 <****> dools, is "id" unique?
02:58 <****> Mrdini: yep
02:58 <****> a bit like bits <--- XOR even
02:58 <****> dools, there you go then
02:58 <****> Mrdini: select field1 OR field2
02:59 <****> ToeBee, huh?
02:59 <****> Mrdini: right. so what should i group by to get the total?
03:00 <****> dools - if you do WHERE id = 1, then it'll only return one row :)
03:00 <****> (if id IS unique)
03:02 <****> Mrdini: right, so what i'm trying to do is get the total number of rows in the table, and the data where id = 1 in the same query
03:03 <****> dools: kind of dirty but you could do select (select count(*) from table), id, total, name from table
03:05 <****> but at that point its pretty much like issuing 2 queries anyway...
03:05 <****> is there anyway to oder results by: everything with more then 10 chronologically, then everything less then 10?
03:11 <****> Mrdini: SELECT IF(SUM(col='true',1,0) = COUNT(col),1,0) AS alltrue ....
03:11 <****> there are more possible variations
03:13 <****> arjenAU, ah ha, that should work :)
03:13 <****> might be able to simplify, in essense you just want to make sure there are no false entries, then it's true.
03:13 <****> no, no
03:14 <****> if there are no false entries, they're all true. it's the smae thing
03:14 <****> I want to check for MIXED or NOT MIXED results
03:14 <****> righty. well anyway with IF and magic SUMs you can do what you like, regardless ;-)
03:18 <****> is there a good paper on using blob in mysql?
03:31 <****> hello
03:31 <****> how to do following operation on dates:
03:31 <****> to date A assign the middle between dates B and C. (btw, the B < C). so like A=(B+C)/2 but for dates
03:34 <****> !man date functions
03:34 <****> well, if you looka t the date functions in manual, there is one to get number of days difference between two dates
03:34 <****> once you haev that number, divid it in half then subtract that number of days from C
03:38 <****> so like, C - INTERVAL ... DAYS ?
03:38 <****> the dates are actually timestamps
03:40 <****> What happens if you just try A=(B+C)/2?
03:43 <****> A=from_unixtime((unix_timestamp(B)+unix_timestamp(C))/2)
03:43 <****> thanks man :)
03:43 <****> turned them into seconds
03:43 <****> Oh, I suppose you can't add dates, true.
03:45 <****> So (B+C)/2 wouldn't work. But B-(B-C)/2 would, I guess (assuming intervals can be divided by numbers). Which is silly, for subtraction to be defined when addition isn't.
03:45 <****> Unix timestamps work too, it's all good.
03:49 <****> in a query in which a phrase is encapsulated by single quotes, how could i escape the use of an apostrophe?
03:50 <****> MessedRocker: 'it\'s like this' or "it's like this"
03:51 <****> or you should use placeholders in your code so you never have to manually quote stuff yourself (which is error prone and leaves holes for people to break into systems)
03:52 <****> ah, just as i thought
03:52 <****> thank you
03:59 <****> hi
04:00 <****> anybody there?
04:00 <****> yep, but leaving now since you didn't ask a meaningful question
04:01 <****> lol
04:27 <****> how's everyone doing?
04:28 <****> frankieshakes, I died from blunt trauma about seven hours ago, but thank you for asking.
04:28 <****> Simetrical: hehehe... sorry to hear about it.
04:31 <****> i'm having trouble coming up with a query that will allow me to display a "primary" phone # for a contact. I've got a "contact_phone_numbers" table with multiple #'s per contact... but the "is_primary" field can either be 0 or 1. The problem is I want to display the primary phone number, but if there isn't a "primary" specified, still display a phone # for the given contact(s)
04:31 <****> It's been a while since writing SQL queries... any help would be greatly appreciated!
04:39 <****> anyone around who can lend a hand?
04:40 <****> maybe
04:41 <****> hey chad... any thoughts on the query? it's throwing me for a loop
04:42 <****> what query?
04:43 <****> i'm having trouble coming up with a query that will allow me to display a "primary" phone # for a contact. I've got a "contact_phone_numbers" table with multiple #'s per contact... but the "is_primary" field can either be 0 or 1. The problem is I want to display the primary phone number, but if there isn't a "primary" specified, still display a phone # for the given contact(s)
04:43 <****> It's been a while since writing SQL queries... any help would be greatly appreciated!
04:43 <****> i'm trying to write a query that will display a "primary" phone # from a contact_phone_numbers table... but if there isn't a "primary' specified, it will display any phone # for the contact.
04:43 <****> basically: if contact has a primary tel # display it, else display any tel #
04:48 <****> groupwise max
04:50 <****> The bot is dead.
04:51 <****> version
04:51 <****> yup
04:52 <****> probably dropped in a netsplit
04:59 <****> hi .. how do i drop multiple tables all of which start with demo_ ?
05:01 <****> Egyptian[Home]: with a shell script or stored procedut
05:01 <****> re
05:07 <****> chadmaynard: thanks
05:07 <****> Egyptian[Home]: for what?
05:11 <****> chadmaynard: the shell script .. i have finished the drop
05:11 <****> salam
05:11 <****> well then
05:16 <****> question: group by with rollup, how to divide in the same sql query say every value by the rollup value?
05:16 <****> SUM(views) / ?
05:20 <****> if its at all possible
05:20 <****> I'm having a group by problem, wherever I add it to my query, it screws up the query
05:21 <****> err GROUP BY problem
05:21 <****> SELECT products.category, queries.timestamp FROM products, queries GROUP BY products.category WHERE products.name = queries.name
05:21 <****> group by goes after WHERE
05:22 <****> it worked
05:22 <****> thanks fireangel
05:23 <****> I also learned that you have to GROUP BY , by the opposite of what you think you should
05:23 <****> does anyone use plogger?
05:23 <****> I can't figure out what password hash they use. I guess i'll read the code.
05:24 <****> in the middle of insert processing, my SELECT LAST_INSERT_ID() stops working! just returning 0
05:24 <****> what could be the cause?
05:25 <****> dfas: different session?
05:26 <****> the INSERT and the SELECT happning in different sessions you mean?
05:26 <****> right
05:27 <****> so, no way to select the rollup value in the same query?
05:28 <****> I perform the insert and the select just a row after each other.
05:32 <****> with rollup functions
05:32 <****> group by with rollup
05:32 <****> rollup?
05:33 <****> http://dev.mysql.com/doc/refman/5.0/en/group-by-modifiers.html
05:34 <****> chadmaynard: what im trying to do is a SELECT SUM(column A) / (total sum of column A) FROM table GROUP BY column A with rollup
05:35 <****> but i dont know if its possible to get (total sum of column A), the null part from the rollop, in query


Total 18 pages. You are browsing page 2/18.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last


Tutti i nuovi CAP Italiani. Come ottenere il database completo