9 messages in com.mysql.lists.win32RE: Getting column counter as part of...
FromSent OnAttachments
Greg Quinn20 Jun 2005 07:17 
Reggie Burnett21 Jun 2005 08:49 
Greg Quinn21 Jun 2005 10:31 
Greg Quinn22 Jun 2005 03:03 
emma...@lutecia.info22 Jun 2005 05:12 
Markus Grossrieder22 Jun 2005 06:19 
Ignatius Reilly22 Jun 2005 06:30 
Greg Quinn22 Jun 2005 06:39 
jbon...@sola.com.au22 Jun 2005 15:51 
Subject:RE: Getting column counter as part of query
From:jbon...@sola.com.au (jbon@sola.com.au)
Date:06/22/2005 03:51:07 PM
List:com.mysql.lists.win32

Temporary tables are "per connection" so if you want to see the temporary table, you need to be using the same connection.

-----Original Message----- From: Greg Quinn [mailto:gr@officium.co.za] Sent: Wednesday, 22 June 2005 7:34 PM To: win@lists.mysql.com Subject: Re: Getting column counter as part of query

Thanks,

I have tried this in my program, but when I try to insert into T it says the table does not exist.

If I run this query directly in MySQLCC it works, but in my app, If I run the query on 2 different database connections it does not work. Is this query supposed to run on one connection?

I have tried running both queries at once but I am told there uis a problem with my syntax after the first queries semi colon (;)

What am I doing wrong? Thanks

----- Original Message ----- From: "Ignatius Reilly" <igna@free.fr> To: "Greg Quinn" <gr@officium.co.za> Sent: Tuesday, June 21, 2005 8:32 PM Subject: Re: Getting column counter as part of query

you can create a temporary table with an autoincrement field, and select your data to extract into this table

CREATE TEMPORARY TABLE T( id int auto_increment, first_name varchar(40), ..., PRIMARY KEY ( id ) ) ;

INSERT INTO T SELECT 0, first_name, ... FROM mytable

Now you can use T to extract your data

Ignatius

Greg Quinn wrote:

How does one do this in mySQL?

Basically I am binding directly to a control, in the control I need a

column stating the record #. i.e

# Name 1 Bob 2 John 3 Mary

How do I get the actual record counter as part of a query?