Skip to content

Teradata SQL Same Day Prior Year in same Week

Need help figuring out how to determine if the date is the same ‘day’ as today in teradata. IE, today 12/1/15 Tuesday, same day last year was actually 12/2/2014 Tuesday. I tried using current_date – INTERVAL’1’Year but it returns 12/1/2014. Answer You can do this with a bit of ma…

How to revoke MySQL user privileges for one table?

When I have granted privileges to a user for some specific tables: How do I revoke the privileges for this user, just for table1? Answer Google is your friend! http://dev.mysql.com/doc/refman/5.7/en/revoke.html Syntax: To further explain this answer – I’ll teach how to fish (rather than just give …

XML Schema totalDigits/fractionDigits vs. SQL precision/scale

I’d like to find out the correspondence between XML Schema totalDigits/fractionDigits and SQL numeric precision/scale. 1) Assume we have the following simple type: How would I represent it in SQL? Let’s assume HSQL dialect (it does not matter much). I’m interested in the most restrictive SQL…