@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7



Comments:

<0> guys, help me projecting mysql table.. table is consists for id,item(string) and it's features(ft1...n, n almost 1k) the problems is that i don't want to make 1k columns 8-( suggest what to do?
<1> deuce868: http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html
<1> deuce868: Look at the article and all the comments.
<2> k, thx
<0> i can try to rephrase..
<2> Xgc: ok, I think I have what I want by adding SELECT max(Time) as t
<2> thanks for the help
<0> uniq id, string text, ft1 int, ft2 int, ft3 int, ... ft1000 int.. it looks odd
<2> exp[a]: Have you looked at putting the features in their own table and then referencing them instead creating a 1->many type relationship
<0> well yep i thought, but it's atm more then 1.4k items + queried must be items anyway.. so no reason.. i have to output product and it's features (it could be done by combining features) but also i should able to make a list of products that have one selected feature..
<2> If I am following you right I would set this up so that there were three tables. Items, Features, and a table to tie items to features. That way if 4 items have the same feature it's in the db once not 1000 times for the 1000 items that have that feature. In this way you can query the item and get all ***ociated features as well at the same time
<0> hmm, i need time to understand this....
<3> Xgc: I read three separate articles on normalization - none of them answers my question. which NF form dictates one big table over many small identical ones?
<4> Rabbit you taling about Lookup tables per chance?
<4> exp[a] why put a limit on the features
<3> Ungy: <3> what is "the right thing to do" tm - have a large table with a primary key composed of two columns (id and source) or several small tables, each corresponding to a single source?



<4> exp[a] use a link table a sperate tabel and have each feature ID match to a product ID in that table
<4> |RABBIT|: | it depends on what yrou doing really and how big the data is
<4> |RABBIT| but when in doubt break it out
<1> |RABBIT|: If you split up the data, the key to the data would be [table_name, id]. That's not usually an appropriate approach.
<3> crap...
<3> now when you said it it makes perfect sense :)
<4> |RABBIT| if you look in the case of lookup tables if you need to display a report to display a vvalue you could essentially make many joins to teh same table with different types as keys
<4> |RABBIT| however there are Arguments for both ways in fact I do do the table_name,ID way for certain things mainly for some advanced automated dynamic query creations but that is a different story all together
<3> Ungy: I agree, just wheb Xgc wrote what he wrote I realized it will be extremely difficult to tech something like DBIx or CDBI how to deal with table_name, id references
<4> Although I am nto too sure why you have an id and source as a primary key that seems a bit odd if this is not a lookup table
<5> are there places on the net where i can download example table data?
<4> xiuan I looked again I am nto seeing it I know it is a logic error on some join but I can;t find it
<5> eg ~100 names/bithday/adress pairs
<5> or some like that?
<4> litb not that I know of I used to use a program called JustData cost me $20 but it woudl spit out all kinds of data for me
<3> Ungy: because different sources can provide the same ids, and I figured it will take quite some logic to prevent the same id from the same source being imported in the db twice (it can happen and I must guar against it)
<3> so I figured I'll just use the uniqueness as a constraint
<4> |RABBIT| so this is a news article repository or somethign liek that?
<3> orders being collected from number of frontends, and because the frontends are ****ty duplicate submissions are not uncommon
<3> actually quite common
<3> sales orders I mean
<4> |RABBIT| I would put a Unique case on the providerID and the ID of the article from teh source btu I woudl still have a seperate primary key for the table itself makes it easier to edit and join
<6> what should I set my bind-address to if I want mysql to listen on 2 network interfaces, 127.0.0.1 and 192.168.11.1, but not on the third network interface?
<3> oh... I can force a column group unique without making it a PK?
<1> |RABBIT|: Yes.
<4> |RABBIT| I am actually working on somethign similar I save a TransactionID MerchantID and a MerchantTransactionID the Primary key is the Transaction ID there is a unique constraint on the MErchantID and MerchantTransactionID
<1> |RABBIT|: It's called a unique constraint.
<4> naknomik you don't you set it to listen to 192.168.1.1 and use localhost (the socket) to connect locally or jsut point to that IP address
<6> Ungy: what if I set it to 0.0.0.0, and then block access to mysql from third interface using firewall?
<4> naknomik since 0.0.0.0 doesn't exist you woudl have onehell of a time cnnecting
<4> naknomik seriously bind it to that one address 127.0.0.1 has absolutly no benefit for you
<6> Ungy: Can't I start mysqld where it listens over all network interfaces?
<4> naknomik: if you do not skip-networking and do not specify a bind-address it binds to all
<6> OK
<4> naknomik but you do know what 127.0.0.1 is right?
<4> Ok I am taking off be back later
<6> Ungy: My linux machine has 2 nics, 1 connected to internal network, 1 to external.
<4> naknomik then bind to internal address
<4> you dont; need to bind to 127.0.0.1
<6> but will localhost work?
<4> naknomik loclhost will work 127.0.0.1 will not
<4> but you can however just point to the internal Ip as well fromt eh same machine
<4> if for some reason the program won;t or can't use the socket
<4> Strange but yes it does happen
<4> OK I gotta go
<6> I removed bind-address, altogether from my.cnf , now it listens on all interfaces, but when I try to connect from an internal network machine, it says, Host so.and.so is not allowed to connect.
<4> !m naknomik GRANT
<7> naknomik: (GRANT and REVOKE Syntax) : http://dev.mysql.com/doc/mysql/en/GRANT.html
<6> aah. ok
<8> SELECT li_blog.*, count(li_blog_comments.comment_blog_id) FROM li_blog,li_blog_comments WHERE li_blog_comments.comment_blog_id = li_blog GROUP by li_blog_comments.comment_blog_id
<8> Any ideas on this one, i get an error
<8> oh got it
<8> ok, i got this: "SELECT li_blog.*, count(li_blog_comments.comment_blog_id) FROM li_blog_comments,li_blog WHERE li_blog.blog_id=li_blog_comments.comment_blog_id GROUP by li_blog.blog_id". How do i make that it would select all of li_blog rows, so i wouldnt just get the ones that have li_blog.blog_id as li_blog_comments.comment_blog_id ?
<8> what i simply mean is that in query when i combine two tables, i only get the results form the first table that have got relations to the other table, although i want to return the ones that don't as well, count 0 :/
<9> Ungy, You about
<10> If i stop a slave, copy it's mysql dir to a new box.. rename all hostname.* files, give it a valid server id in my.cnf.. will it work?
<10> as opposed to shutting down the master.
<11> i have to make a db to ONU for all Inteligence Agencys in the world, so i have a country table, SI(like fbi nsa etc), then cells, the cells can be especialized,general and headquarters, cells have agents and agents have material and do operations
<11> there are undercover agents with fake ids etc...
<11> i got all that



<11> but there are also Double Agents
<11> so an agent can belong to 2 SI
<11> how can i do that any ideias ?
<11> for the undercover its just another field in agent , undercover? if yes it has data in another table
<11> with the fake info
<11> but for doubles its kind weird
<11> its more of a data base problem than an sgdb
<4> Drakas change join to Left JOIN
<4> drue in theory it will
<10> Ungy, thanks
<4> donpeyote umm just cause you could be a member of Al Queda I won;t help you
<4> donpeyote but you coudl always doa link table someone coudl be a triple agent
<4> ok off to cook dinner
<12> *yawn*
<11> eheh
<13> how would i go about setting the value of a column if a condition is true?
<11> i have bin laden director of CIA :p
<14> ico2: like update table set field = something where column = 'something'?
<13> no
<13> field within output
<13> in a select
<13> so, WHERE columnA="b" AND SET columnB="test"
<13> except that syntax doesnt work obviously
<14> so like select if(col = 'something', 'yes', 'no')
<13> ah
<13> thanks
<13> but will that work if there are loads of other things being selected?
<13> where will it go in my query
<13> this is already a _really_ long query
<13> hmmm
<13> wait
<13> that is not my problem
<13> lemme pastebin
<13> http://pastebin.com/539315
<13> now lemme explain real problem
<15> lemmings
<13> i select users and userGroups twice
<13> with different aliases
<13> but they remain the same
<13> ie: the 2 are not selected like seperate tables
<15> you have a duplicate alias
<14> use the alias prefix if(alias.col, 'yes', 'no');
<13> i want to use a table twice, with different names, and treat it as 2 different tables
<13> forget the if thing, that was me not noticing the real problem
<16> Hello all, I have a table that a column needs an index added. Refer to pastebin to see table structure. Want to know if the folliwing command will do what I need.
<14> well how are the two same tables joined?
<13> zircu: it is the same table
<13> 1 table
<16> http://hashmysql.org/paste/viewentry.php?id=1393
<13> i want to treat it as 2
<16> Is this right? ALTER TABLE field ADD INDEX (websiteId);
<14> select * from table1 t1, table1 t2; will equal 2 times the number of records in table1
<13> i want it to behave as if there is 2 copies of it
<16> Yes yes, I know how unimaginative it is to name a table "field", but that was done by the developers. I'm just a lowly sysadmin.
<13> yes, but select * from table1 t1, table1 t2 WHERE t1.col=1 AND t2.col=2 wont work
<13> refer to my code in the pastebin
<13> i get targetName equalling userNAme
<13> *userName
<13> lemme reorganise my code a bit for a sec
<16> Silly me. The query that takes forever is searching on the websiteId field: 'select count(*) from field where websiteId=210557;'
<1> ico2: Use UNION.
<1> ico2: But why do you want to do that? Why not just use SELECT ... FROM table1 WHERE col=1 OR col=2?
<13> fixed
<13> 1 more question
<13> is there a way do conditionally select columns, so like if i select the same column from several tables, how can i decide which one to use for a particular row being outputted?
<17> hello
<17> is the mysql 5.0 the final server version
<1> ico2: tblname.colname
<13> nonono
<13> in the output
<13> so like:
<1> ico2: tblAliasName.columnName
<1> ico2: Yes.
<13> i mean like: if a condition is true then the program requesting the data is given targetName selected from one table, otherwise that from another


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #mysql
or
Go to some related logs:

/etc/motd debian etch
ubuntu hpna network
volumes_visible hide floppy
Sorry, Xv not supported by this X11 version/driver
#css
#physics
#css
#linux
Couldn't find package gset-compiz
gaim signal name



Home  |  disclaimer  |  contact  |  submit quotes