Barry napsal(a):
Dušan Pavlica schrieb:


Barry napsal(a):
Hello Everyone!

I am having a big problem with counting inserting rows.

This is my Query:

SELECT MAX(id) INTO @maxid FROM table1; // @maxid is now  44

INSERT INTO table2 (orderid, someothervars)
SELECT @maxid +1, blahvar FROM table3;

try
select @maxid:=max(id)-1 from table1;
insert into table2 (orderid, someothervars)
SELECT @maxid:[EMAIL PROTECTED] +1, blahvar FROM table3;

dusan
Thanks dusan, thanks filip that works perfect :)

Can you tell me where i can find that " := " function on the mysql dev site? Search function don't allow " := " and i didn't found it.

That would be very nice :)

My best regards
    Barry

Barry,

it's not function, it's assignment operator. Try to search 'user-defined variables' in manual. It's chapter 9.3 in version I have

Dusan

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

Reply via email to