| Xgc | DanJ22: You need to use something like aggregation and a JOIN. |
| DanJ22 | Hrm, I wrote out an inner join but had grouping errors |
| Xgc | DanJ22: Start with something really simple and work from there. Don't confuse yourself trying to do it all at once. DanJ22: COUNT(t.CATALOG = t.CATALOG) <-- This is a problem. DanJ22: I dno't know much about your schema, but it looks like you left out at least one join. |
| DanJ22 | hrm, hang on lemme check history |
| hays | Xgc: kimseong, thanks, got it |
| DanJ22 | sure I already put one in |
| Xgc | DanJ22: Right. You need another. DanJ22: You describe a problem with A table (that means one to me) and then proceed to show a join of 2 tables. DanJ22: That ONE table in your description needs to be joined with itself. That other table is pretty much immaterial with respect to the aggregation you need to do. |
| rtan | helo |
| DanJ22 | actually, come to think of it I need to pull the initial list seperately brb |
| rtan | helo DanJ22 |
| Xgc | DanJ22: having said that, maybe your description was completely wrong and as a result my comment is wrong. |
| DanJ22 | ok I have 2 tables, first table has catalog #'s, table 2 has catalog, name, artist, title and Each catalog number in table 2 appears anywhere from 1 - 4 times |
| Xgc | DanJ22: Ok. So start by joining t2 with itself to find the counts you need. |
| DanJ22 | i need to pull all rows in table 2 where cat# in table 1 = cat# in table2 |
| arooni | ok if i want a generic table i'll inherit from... and it should track ad impressions and ad clicks.... what should i call that table what is a higher level name than impression or click |
| DanJ22 | then count how many times cat# in table 2 occurs (anything from 1-4) |
| Xgc | DanJ22: You only need table 2 for this part. Are you saying some t1's are not found in t2 and you need to see a count of 0 for those? |
| DanJ22 | yes |
| Xgc | DanJ22: That's fine. Just perform the t1 LEFT JOIN t2 ON ... GROUP BY t1.catalog ... to find the counts and then JOIN this result with t2 to obtain any non-aggregates needed. |
| Woosta | Given an ENUM() field .. is there any query that will return the values from that list? Docs say: If you want to determine all possible values for an ENUM column, use SHOW COLUMNS FROM tbl_name LIKE enum_col and parse the ENUM definition in the Type column of the output. |
| Xgc | Woosta: Maybe via information_schema. But this is one reason enums aren't a great idea. You should have a separate table. |
| Woosta | Yeah, I'm kinda stuck with it .. I'll just parse it |
| rtan | hello |
| arooni | i have two types of users.... authors + readers .... readers pay authors money. authors are paid based on the number of downloads of their ebook i want to allow authors to checkout... and get paid based on their downloads how should i model the payment side in terms of tables |
| rtan | hey i have 3 colums Pin,Win,Segment and i want to combine all value into one colums Project Number, how can i write the CASE statement CASE WHEN dbo.Project.PIN IS NULL THEN dbo.Project.WIN ELSE dbo.Project.PIN END AS ProjectNumber |
| blueandwhiteg3 | where does mysql keep its data files under FC2? i feel like an idiot, but i can't easily find this location.... |
| firewire | show variables like 'datadir'; |