Re: HELP with code and results display
Date: Mon, 18 Apr 2011 08:58:58 +0000 (UTC)
Message-ID: <iogugh$mkl$1_at_dont-email.me>
mj wrote:
> here's test code and results from same.
>
> SELECT distinct
> (SELECT count(*) FROM TABLE1)*100/(SELECT count(*) FROM TABLE2)
> percent
> FROM TABLE1, TABLE2
>
> Results = 46.571428571428571428571428571428571429
>
> I'm trying to get a percentage as result, displayed as "46.57%" but
> can't figure out how to trip decimals and display the percent sign.
>
> Any help would be much appreciated.
>
> Thanks
You're obviously right at the beginning of your SQL learning journey. Which is fine, we've all been there. But there are some fundamental problems with the code you've used above, & you're unlikely to get a positive response here with such basic questions - it's not really what this group is for.
I suggest you get a 'beginners guide to SQL' book & read it thoroughly before you write any more code. Until then, google for 'oracle dual' & 'cartesian product' before using that bit of code anywhere important.
-- Preston.Received on Mon Apr 18 2011 - 03:58:58 CDT