538 reputation
1415
bio website phpfreaks.com
location United States (but travelling)
age 33
visits member for 1 year, 7 months
seen 2 days ago
stats profile views 31

I am not a handy programmer but I play with php with a hope to develop creative ideas.


Jan
9
comment How to re-arrange rows to best fit within groups?
This method will change the order in cat, which is the main requirement. It is needed to preserve the order in each category. The flexibility is where categories are mixed.
Dec
22
comment Multiple “GROUP_CONCAT”s with WHERE clause
I think the first solution is simple and elegant and well fit with my need.
Dec
21
comment How to mix pairs of rows without JOIN (in a temporary table)?
@JeremySmyth mysql does not support JOIN to self on temporary tables. Temporary tables can be referenced only once in a query.
Dec
20
comment How to re-assign two variables in a conditional UPDATE
very subtle solution, and I enjoyed your useful presentation!
Dec
17
comment How to categorize rows by SUM of a column in mysql?
@dezso why subquery is not slow? subquery needs to conduct the process row by row. Am I wrong?
Dec
17
comment How to categorize rows by SUM of a column in mysql?
Thanks for two versions, but please note that the question originally asked for UPDATE the table, rather than SELECTing the data.
Dec
17
comment How to categorize rows by SUM of a column in mysql?
yes I was thinking of user-variable, but I wished not to use sub-query, as it is slow in long tables (which is my case). But it seems, I have no other choice!
Dec
12
comment Which RDBMS has the most advanced “table-valued” functions?
@JustinCave The reason for denormalization is that the individual words, if see in the original question, have no meaning or dependency in the database. We just want to calculate the sum of scores for a sentence (not even word). Thus, splitting the cell to numerous rows is not beneficial. De-normation in this case, is to create another table with one-to-many relationships to calculate the sentence score. This is indeed my goal; but that table should be virtual, because after update it is no longer needed.
Dec
12
comment Which RDBMS has the most advanced “table-valued” functions?
@JustinCave I agree with your standpoint, but sometimes it is needed to de-normalize a database.
Dec
12
comment Which RDBMS has the most advanced “table-valued” functions?
Perl/Python/PHP all can handle string functions well, but the problem is that fetching data and updating the database for thousands of queries is not efficient in practice. I've heard that PostgreSQL is fairly advanced, but I did not find more string functions comparing with mysql (of course, by a quick review).
Dec
12
comment Which RDBMS has the most advanced “table-valued” functions?
This is a subtle solution for my case, but unfortunately I'm on linux.
Dec
12
comment Which RDBMS has the most advanced “table-valued” functions?
@RemusRusanu I do not look for an advanced RDMBS, as I think mysql is. I think string functions of mysql are not very extensive. I am looking for a RDBMS (advanced or basic) but with a wide range of functions for strings (table valued).
Dec
12
comment Which RDBMS has the most advanced “table-valued” functions?
@MartinSmith I edited the title as you instructed.
Dec
4
comment How to concatenate a column after x rows?
@RolandoMySQLDBA what should I like it when it magically and perfectly works? I love it :)
Dec
4
comment How to concatenate a column after x rows?
@FrustratedWithFormsDesigner this is a simple loop ordered by the primary key (auto_increment).
Dec
4
comment How to concatenate a column after x rows?
@RolandoMySQLDBA yes, exactly! I want to reset the sum, and calculate the sum to reach the next 20. In fact, this is a loop of INSERTs for groups reaching the sum of frequency of 20 after the last INSERT.
Dec
4
comment How to concatenate a column after x rows?
This is brilliant, but this will work for one INSERT when the sum of frequency reaches the value. But I want to repeatedly INSERT and reset the sum of frequency
Dec
4
comment How to concatenate a column after x rows?
@FrustratedWithFormsDesigner I added a simple example to clarify the process
Nov
27
comment Resolving DUPLICATE for a column with UNIQUE
now it seems to be a practical solution!
Nov
26
comment Resolving DUPLICATE for a column with UNIQUE
How should I know that the duplicate is on the column title? it can be from columns abr or name, which are also UNIQUE.