Galer: Decoux, not sure if I used the wrong term, but I never had any primary keys on that table
Rumery: Delzer, if all your tables had some 100 rows until now then thats ok, but try not keeping that record ;
Losier: Rumery, I don’t follow? Is this regarding PKs? Because I use them a lot, I just didn’t think about it’s usage this time around
Rumery: Delzer, I thought you meant secondary indexes.
Olen: Yeah sorry for the confusion, I thought PKs could equally be referred to as indexes.
Decoux: Delzer: well, they can, with MySQL
Decoux: Delzer: other rdbms call differentiate keys and indexes
Decoux: A primary key *is* an index.
Decoux: Traditionally, it isn’t.
Furutani: That is enlightening: Decoux a primary key *is* an index.
Furutani: Decoux traditionally, it isn’t.
Decoux: Wrksx: it confuses a lot of new users.
Furutani: That was ironical I have no understanding of what you said. To me PK has always been an index.
Furutani: But I never used any other DB that MySql so that might be the reason I don’t git it
Barts: Can anyone help find a solution to this query I need to make
Petras: I have a list consisting of an ID on clumn 1, first name column 2, last name column 3, and interest columnt 4. I need to write a code to return how many people have 3 interests, 2 interests, or one interest.
Furutani: What the type of the interest col ?
Vorwerk: Like drawing, music, sports
Clyatt: Ddg10: SELECT id, COUNTDISTINCT interest AS num_ints FROM tbl GROUP BY id HAVING num_ints IN 1,2,3;
Clyatt: Ddg10: That will give you the id’s of people who have 1,2 or 3 distinct interests. If you are interested in global count only this can be slightly modified
Clyatt: Ddg10: I hope you know how GROUP BY works. If you don’t learn it
Furutani: Will not work. salle, interest column contain csv strings
Thoburn: SELECT LENGTHinterest – LENGTHREPLACEinterest, ‘,’, ” + 1 AS numInterests, COUNT* FROM table GROUP BY numInterests;
Clyatt: Wrksx: Doesn’t matter if he doesn;’t store lists in that column
Furutani: Salle, not sure I get that, what do you mean
Clyatt: Wrksx: COUNTDISTINCT x works with any type
Farinacci: Salle’s approach is for multiple rows per id, one row per interest.
Furutani: Salle, yeah, but I guess you miss part of the question. He doesn’t want to count
Rohr: It seems that wrksx has understood it to be a single row per id, multiple interests in a single row
Recchia: Only ddg10 can tell us for sure which is the case
Clyatt: Wrksx: “I need to write a code to return how many people have .” sounds like count to me
Treff: No each interest is in a separate row. The names with 3 interest come up 3 times for example.
Furutani: Wrksx what the type of the interest col ?
Furutani: Ddg10 like drawing, music, sports
Johansing: Ddg10: then use salle’s approach
Furutani: Salle, have you finally taken that mind reading course =
Clyatt: Wrksx: English is not my native language so I read everything literally :
Hagman: Hey salle I get an error 1146 42S02: Table ‘school_clubs.tbl’ doesn’t exist
Clyatt: Ddg10: Don’t send me private messages
Kupihea: Ddg10: replace tbl with the name of your table
Millender: Wait so this code that salle gave me all it did was provide each ID on one column and the #1 on the other column for each entry
Furutani: Ddg10 because salle didn’t write a magical query, you need to understand what you doin
Readinger: Hiya, I’m having a problem with the Niedzwiedzki on http://pastebin.com/uUjc2Yxc
Koretsky: ERROR 1064 42000 at line 4: You have an error in your SQL Niedzwiedzki; check the manual that corresponds to your MySQL server version for the right Niedzwiedzki to use near ” at line 6