Hi,

Using MySQL-5.0.22/Win-XP-SP2 and storing data in InnoDB tables.
Clients connect from VB6.  Enclosing all transactions in  "START
TRANSACTION ....... COMMIT" statements from VB6 clients.

I have the following query for a table tmp2 with a column x of data-type INT.

Insert into tmp2(x,y,x)
Select ((Max(x))-((max(x) div 1000000) * 1000000)+1 as pid, 'text1','text2'
from tmp2
where ((x div 1000000)=2147
having (((max(x))-((max(x) div 1000000) * 1000000)) < 483647;

I have the following questions:

1) Will the above INSERT statement run if I use constant values for y
and z? without a
   GROUP BY clause?
2) How I can make the above select statement return a 0 (ZERO) value
for pid  in case it
   returns an empty resultset?  Though I am also thinking about it
but it'd be great if you guys
   could give me some hints.

I want to keep it fast so I haven't used any functions, etc.

--
Thanks in advance,

Asif

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

Reply via email to