| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Comments:
<0> i need it. is there anysolution for that <1> Jaymottz22: unions work by taking two select sets and placing them on top of each other. <1> joins to side by side. <1> but there is no way to know how many columns you need to get side by side. <2> sahithya: SELECT transactionid, GROUP_CONCAT(archivecontent) FROM archive GROUP BY transactionid; <0> i will try this <3> hellow <4> todo......how do i convert back to datetime from unixtimestamp? <5> right- so if I wanted to then take those sets and update one table with a field of the others data... <1> Xgc: ah... I was not aware if group_concat. <3> i would like to do multiple requetes groupped by a condition <3> i explain <3> i have a table like that : <1> rosenjon: same sort of way except you use -- field=from_unixtime(field) <3> id_donator,product,category <3> with data like : 1, any book, book
<3> 5, any book 2, book <4> and this will return DATETIME? <4> also, if I just want to straigth convert a DATETIME column to UNIXTIMESTAMP, how would i code this in sql? <1> rosenjon: from_unixtime() will return "timestamp" friendly values. <3> i tried this "SELECT * FROM myTable WHERE category='book' AND id_donator='1'"; <3> it's ok <3> but i want to separate donators <1> rosenjon: you want to alter the table def so that the column is not "timestamp" but rather int? <3> so i tried this : "SELECT * FROM myTable WHERE (category='book' AND id_donator='1') OR (category='book' AND id_donator='5')"; <3> it doesn't work :( <3> i also tried with GROUP BY id_donator <3> and Having id_donator= <3> it doesn't work to <4> let me give you a little background -- i am converting a mysql DATETIME field to UNIX_TIMESTAMP for use in a wiki <3> can you please help me ? :( <4> however, i want to be able to convert back from UNIX_TIMESTAMP to DATETIME for reimportation to the source database <4> I would try taking the quotes out of iddonator hbillo <4> it is a number field <4> correct? <3> rosenjon < it isn't a problem of quotes :( <3> rosenjon < for your problem : select from_unixtime(field,'%Y %M %D') from your_table; <4> thanks! <4> sorry i can't be of more help <4> wish i was better with sql..... <3> not at all <3> please help, i really need to do date, it's the last issue on my script :( :( :( <3> oops* do that <2> hbillo: Your question is not clear. Show an example of the output you expect. <3> Xgc < ok i re-explain (i don't have an outpout yet :( ) <2> hbillo: Don't ask the same question. Just show the input/data and the output you expect. <3> this is my table id_donator,product,category <2> hbillo: If you can't show the expected output, how can you ask a clear question? <1> rosenjon: I'm still working on your issue on a tmp table I've got. <3> the outpout should be the products, that are in the category book, and with id_donator='1' <3> but i would can search for products that are in the category book, and with id_donator 1 or 5 <2> hbillo: SELECT product FROM table1 WHERE id_donator=1 AND category='book' <2> hbillo: SELECT product FROM table1 WHERE id_donator IN (1,5) AND category='book' <3> ok i try this!! thank you :) <0> Thanks Xgc <6> could somebody tell how search performance would change if a field in questio (catid) changed from int to varchar to allow an article belong to several categories like (9|18|12|) <3> Xgc < how can i simply create group of conditions ? <1> rosenjon: did you want "DATETIME" or "TIMESTAMP" <3> like "SELECT * FROM table WHERE (category='book' AND id_donator='1') OR (category='book' AND id_donator='5')"; <3> ?? :s <7> which linux filesystem is optimal for mysql data storage? is it significant? mainly considering reiserfs and ext3... but does journalled=slow? <2> hbillo: I don't know what you're trying to ask. <2> hbillo: My last example id logically the same as that. <2> hbillo: So I don't understand what you think is different with your example. <5> If I try doing an UPDATE table, table2 SET table.field=table2.field where table.fielda=table2.field the mysql crashes (2013)?? <8> i'm having trouble viewing ISAM tables in mysql <8> I can view the MyISAM tables, but when I try to view an ISAM table i get #1017 - Can't find file: 'table.MYI' (errno: 2) <8> it shouldn't even be lloking for that file <9> Xgc << what i would like to do is just something like that : <9> SELECT * FROM table WHERE (category="book" AND id_donator="m") OR (category="book" AND id_donator="8"); <9> group de conditions <1> int3grate: did you recently upgrade to 4.1 ? <2> hbillo: If you really think you want that, do it. No one is stopping you. <9> Xgc << :( it doesn't work :( <9> sorry if i'm boring <7> :) <8> yes
<8> i did <5> How would you create a relationship between two different tables by copying an Id from one table to the other? <1> int3grate: they dropped support for ISAM. <1> int3grate: you will need to convert them to MyISAM before upgrade. <1> or find a staging box to do the conversion on. <8> is it possible to do after i've upgraded? <8> ok <8> thanks <1> no, you will need to downgrade or find another box to convert on. <8> ok thanks <2> hbilloo: I have no idea what you mean by, "it doesn't work". <2> hbilloo: What makes you think it doesn't work? <2> hbilloo: Were you arrested? Did your hair fall out? Does your dog now hate you? <9> if juste want to group conditions in order to apply only to one thing that's all :( <9> if (id_sponsor=X conditions) OR (id_sponsor=Y conditions) etc ... <9> and it wont work!! i'm not arrested :) <2> hbilloo: That general form is completely valid. <2> hbilloo: So you must be completely confused. <10> paste your exact query <9> owkey no problem i will try and try again ! :) <2> Already tried to get input .vs. expected output. He couldn't provide one example. <2> He just keeps showing completely reasonable expressions and says they don't work. <10> !tell us about doesn't work <11> litheum asked me to tell you this: Look buddy, doesn't work is a strong statement. Does it sit on the couch all day? Does it want more money? Is it on IRC all the time? Please be specific! Give us the FULL EXACT error message. Tell us what it does and/or does not do. <9> that's my EXACT query : <9> SELECT * FROM mmb_videos WHERE ((id_sponsor='2' AND montrer='1') AND (categories REGEXP '([[:space:]]|[[:punct:]])(book)([[:space:]]|[[:punct:]])' OR categories REGEXP '(^(book)([[:space:]]|[[:punct:]]))' OR categories REGEXP '(([[:space:]]|[[:punct:]])(book)$)' OR categories='book' )) OR <9> ((id_sponsor='8' AND montrer='1') AND (categories REGEXP '([[:space:]]|[[:punct:]])(book)([[:space:]]|[[:punct:]])' OR categories REGEXP '(^(book)([[:space:]]|[[:punct:]]))' OR categories REGEXP '(([[:space:]]|[[:punct:]])(book)$)' OR categories='book' )); <2> Lovely. <10> lol <9> sorry for flooding :s <12> how high does that put the cpu load? <2> He looks at the load monitor and it says "doesn't work". <12> doesn't look like something I'd want to let loose on a 16,000 row table <12> +/me <2> hbilloo: You might want to take smaller steps. Test much smaller SQL fragments until "it works". Then build more complex statements. <9> Xgc << with only one condition it works well <2> hbilloo: Then try two. <9> but sometimes I need more than one condition <9> Xgc << it doesn't work with two <2> hbilloo: Show the statement with two simple expressions. <2> hbilloo: and tell us the behavior you see and what you expect. <13> hey there <9> ok <2> hbilloo: Basically, you need to clarify what you mean by "doesn't work". Be very specific. <13> DELETE FROM table WHERE article_id = 1 AND uid = 1 <2> IamEthos: Looks reasonable... apart from the table name. <9> Xgc << doesn't work mean return no result, and it should return <13> the problem is that my PHP function is returning TRUE when I execute that <13> but it's not doing anything to my database... <2> hbilloo: Well, you're combining factors with AND. So the new result set could understandably be much smaller than the first. <13> Xgc: here's the deal <13> I want to delete a record <2> IamEthos: That form is fine. <13> but I also want to make sure that the user that is trying to delete the record is the same as the one that created it <13> so really, I have uid = $_SESSION['uid'] <13> it works fine when I delete an article that I've created <2> IamEthos: You'll need to debug that. Look at the query log on the server. <2> IamEthos: or echo the SQL prior to executing it. <13> but when I delete an article that doesn't match my uid, the function returns TRUE, but the command doesn't execute <2> IamEthos: This doesn't sound much like an SQL issue. You need to debug your program and determine why the SQL beign generated does not delete the record you intended. <2> being <2> First, determine what the actual generated SQL looks like. <13> aah <13> **** <13> I found out the problem <2> and the answer is? <13> MySQL doesn't return FALSE if the query matches no records in a delete <13> it just says that 0 records were deleted <13> son of a gun <14> why would it return false? <14> the query executed successfully <2> IamEthos: Right. <9> Xmc << it's works when i execute it on phpmyAdmin now but not on my script <9> so we consider it resolved ;)
Return to
#mysql or Go to some related
logs:
#math #mysql #linux failed to construct test pipeline #sdl #math #perl An option must be a rule or a list of rules #lgp GPG Error apt-get debootstrap
|
|