RES: Getting column counter as part of query

RES: Getting column counter as part of query

am 22.06.2005 13:51:32 von fabiomeira

Can I see a temporary table from another database?

-----Mensagem original-----
De: Greg Quinn [mailto:greg@officium.co.za]=20
Enviada em: quarta-feira, 22 de junho de 2005 07:04
Para: win32@lists.mysql.com
Assunto: 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=20
table does not exist.

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

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

What am I doing wrong?
Thanks

----- Original Message -----=20
From: "Ignatius Reilly"
To: "Greg Quinn"
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?
>>
>>
>=20


--=20
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: =
http://lists.mysql.com/win32?unsub=3Dfabiomeira@saocamilo-es .br




--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org