I don't think you'll be able to do it, because you can't use stored
procedures with MySQL.  You can use a temp table, if you want, though.  Just
run a CREATE TEMPORARY TABLE statement.  However, I suspect that pulling the
raw recordset back to CF and processing it there will be faster, because
you're going to have to run a bunch of separate queries anyway, and doing
QofQ on a recordset is almost exactly equivalent to using a temp table.

barneyb
  -----Original Message-----
  From: [EMAIL PROTECTED] [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
  Sent: Saturday, October 18, 2003 10:47 PM
  To: CF-Talk
  Subject: MySQL Heirarchies

  I am stumped on a MySQL query, it involves returning information sorted
into a heirarchy.

  There's this table with the following fields: item_id, parent_id, and
comment. Item_id is the unique identifier of each record, and each record
can be a child of another. Parent_id reflects this relationship.

  I need to return a recordset sorted by parent_id, i.e.:

  item_one
  -- item_two
  ---- item_three
  -- item_four
  ---- item_five
  ------ item_six
  -------- item_seven
  item_eight
  -- item_nine
  ---- item_ten

  etc...

  Help! I know how to do this in SQL Server and Oracle using temp tables,
but am not finding the answer in MySQL.

  M

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to