bruce wrote:

thanks for the reply...

and my bad on the diff between the sql. the actual sql had ~100 values. (i
simply cut it to demonstrate what i'm trying to do!!)

i took the two tables created by the initial sql statements and modified
them so that they both had the same structure. i then added/deleted/etc..
untill i got to a table that gave me all the information i needed, but i
need to figure out how to reorder it...

the sql/query you provided is similar to what i had created when i 1st
started. however, it only gives the actual join of the two tables. i'm
really trying to get a 'merge' of the information between the two tables...

I don't understand what you mean. What is a "merge"? Do you simply want all the rows from one together with all the rows from two? That is, you want "duplicate" rows where part of the info is in each row? Something like


 +-----+------+-------+------+-----+--------+
 | ID  | type | user  | ID2  | uID | status |
 +-----+------+-------+------+-----+--------+
 |  40 |    1 | admin |  157 |  40 |   NULL |
 |  40 |    1 | NULL  | NULL | NULL|   0    |

and so on?  I can't imagine why, but OK.

here's what i have so far:

<snip>

mysql> select * from ta;  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  how to reorder
+------+------+--------+------+------+------+
| ID   | type | status | user | ID2  | uID  |
+------+------+--------+------+------+------+
|  40  |    1 | admin  |  157 |  40  | NULL |
| 102  |    1 | admin  |  405 | 102  | NULL |
| 257  |    1 | admin  | 1025 | 257  | NULL |
| 267  |    1 | admin  | 1065 | 267  | NULL |
| 379  |    1 | admin  | 1513 | 379  | NULL |
|   40 |    2 |      0 | NULL | NULL | NULL |
|   40 |    3 |      0 | NULL | NULL | NULL |
|   40 |    4 |      0 | NULL | NULL | NULL |

<snip>

if i could figure out how to reorder the table, to group all the 'ID'
together, followed by the 'type'.

Ordering is done with ORDER BY. To get the results in order by ID and type, you need


  SELECT * FROM ta ORDER BY ID, type;

thanks

-bruce

Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to