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

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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

Reply via email to