0
select COUNT(*)  from T1,T2

In the above query I just try to get the number of possible permutation combination can be made. Both are very huge table which have 27182708 rows.

When I try to execute above query it throws Arithmetic overflow error.

I have tried bigint conversion also but same response.

Any suggestions ?

1 Answer 1

4

Try using COUNT_BIG instead. This will return a bigint instead of an int, which may solve your problem.

Also, while it probably doesn't make a huge difference here, using ANSI Joins is a bad habit to get into.

Sign up to request clarification or add additional context in comments.

1 Comment

You will need to cast those numbers as bigint before you multiply them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.