Posts Tagged variable

Display row number in Mysql Select Query

How many times did want to have the row number or the position of the row in the selected query? I had many cases where I needed this feature. I needed the feature for printing the rank of a person where each row is the mark of the person. So lets see how to implement this in mysql.
There is no straight forward function or query parameter to do it (At least none I know of). So I am writing the query to declare a variable and increment that variable on printing that variable along with printing each row. So it just displays the variable on each row. So here is sql query for it. Try it out and tell me.

Continue reading “Display row number in Mysql Select Query” »

, , , , ,

1 Comment

Automatic Desktop Wallpaper Changer for Linux

I have a lot of wallpaper that I wanted to switch automatically. After a lot of search i found that there a command way to control all the gnome settings. So I the command I used is “gconftool-2“.
So code is like:

Continue reading “Automatic Desktop Wallpaper Changer for Linux” »

, , , , , , , ,


Customizing Mysql Prompt For multiple Servers

If you are using mysql regularly on multiple servers its really useful to have the promt in mysql to show something more than mysql>. It would be useful if it showed the username,hostname, current database and things like that.
So how to do this.

Continue reading “Customizing Mysql Prompt For multiple Servers” »

, , , , , , , , , , ,