[nfbcs] Counting parentheses

John G Heim jheim at math.wisc.edu
Mon Oct 26 17:18:35 UTC 2015


Listen to the sql query a character at a time adding 1 to the count each 
time you cursor over a left paren and subtracting one each time you 
cursor over a right paren.  It's like how they count cards in Vegas.


The only problem with this method is that you might get to the end of 
the query and discover that you are missing a parenthesis but it might 
not be clear where. What I would do in this case is do it again, this 
time listening for the point where I know I should subtract 1 instead of 
add. Or just take a shot and put a right paren at the end which is 
almost always the solution anyway.




On 10/26/2015 12:01 PM, Tracy Carcione via nfbcs wrote:
> I am having trouble keeping track of parentheses in complicated SQL
> statements.  Perhaps when I know SQL better, it will be less confusing.
> Sometimes I have an abacus handy to keep track of counts, but not always.
> What methods do people use to make sure there is a ) for each (?
> Thanks.
> Tracy
>
>
>
> _______________________________________________
> nfbcs mailing list
> nfbcs at nfbnet.org
> http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
> To unsubscribe, change your list options or get your account info for nfbcs:
> http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/jheim%40math.wisc.edu
>

-- 
John Heim, jheim at math.wisc.edu, 608-263-4189, skype:john.g.heim, 
sip:jheim at sip.linphone.org




More information about the NFBCS mailing list