* Tarik Kutluca
> 1. I need to store dynamic sized tables with different row and
> column sizes, but all small tables ( like 2*5, 3*1,5*3)
> 2. For this purpose i created a table to store each value of the dynamic
> sized table, also with the row and the column number, so this is something
> like
>
> aij for an i*j table in each row storing a, i, j
>
> 3. I am trying to figure out the fastest way to obtain the table to a
> recordset having i*j size, do you think i may accomplish this with a self
> join, i couldn't create this sql query,
>
> any help would be great, for now, i am using something like this:
>
> for i=0 to n
> for j=0 to m
> set rsa=cn.execute("SELECT col_id,value from ij where
> table_id='"+cstr(table_no)+"' and row='"+cstr( i )+"' and col='"+cstr(
> j )+"'" )
> next
> next
>
> If i could obtain this matrix with one query from mysql then that would
> increase my performance, don't you think so?

Yes, it would. But why the self join? Why not simply:

"SELECT col_id,value FROM ij WHERE table_id="+cstr(table_no)+" ORDER BY
row,col"

If the table_id is an integer, you don't need to quote it. You may want to
select 'row' and 'col' as well as 'col_id' and 'value', to be able to know
the current position in the loop.

--
Roger


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to