Thursday, April 16, 2009

Mo' quotes

"Public opinion, or what passes for public opinion, is not invariably a moderating force in the jungle of politics. It may be true, and I suspect it is, that the mass of people everywhere are normally peace-loving and would accept many restraints and sacrifices in preference to the monstrous calamities of war. But I also suspect that what purports to be public opinion in most countries that consider themselves to have popular government is often not really the consensus of the feelings of the mass of the people at all, but rather the expression of the interests of special highly vocal minorities — politicians, commentators, and publicity-seekers of all sorts: people who live by their ability to draw attention to themselves and die, like fish out of water, if they are compelled to remain silent." - George F. Kennan

"Condemn me, it does not matter: history will absolve me." - Fidel Castro

Wednesday, April 8, 2009

Favorite Aristotle quotes

"A tyrant must put on the appearance of uncommon devotion to religion. Subjects are less apprehensive of illegal treatment from a ruler whom they consider god-fearing and pious. On the other hand, they do less easily move against him, believing that he has the gods on his side."

"Money was intended to be used in exchange, but not to increase at interest. And this term interest, which means the birth of money from money, is applied to the breeding of money because the offspring resembles the parent. Wherefore of all modes of getting wealth this is the most unnatural."

"It is simplicity that makes the uneducated more effective than the educated when addressing popular audiences."

"The young have exalted notions, because they have not been humbled by life or learned its necessary limitations; moreover, their hopeful disposition makes them think themselves equal to great things—and that means having exalted notions. They would always rather do noble deeds than useful ones: Their lives are regulated more by moral feeling than by reasoning.... All their mistakes are in the direction of doing things excessively and vehemently. They overdo everything; they love too much, hate too much, and the same with everything else. "

"Even when laws have been written down, they ought not always to remain unaltered."

"The basis of a democratic state is liberty."

Friday, April 3, 2009

Update a particular number of rows

There are times when you only want to update a specific number of rows. In Oracle, the way to do this is to use the rownum variable in the following way:

Update x
set x.foo = 'hello'
where rownum <= 500;

This way, Oracle will only update the first 500 records it finds.

You can use rownum in virtually any DML statement. Try it on a select statement:

select x.foo
from x
where rownum <= 10;

Your result set will only have the first 10 records displayed on the screen.

Thursday, April 2, 2009

Joins in an Update statement

I spent a great deal of time trying to find out how to do an efficient JOIN in an UPDATE clause on Oracle. Tom has some great input on this:

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:164612348068