Sunday, March 29, 2009

Sql Joins

Saturday, March 28, 2009

inserting a billion numbers in a mysql table

mysql.exe -u root -p < proc.sql

proc.sql contains :

use mbm_db;

delimiter //

create procedure sp4()

begin

declare i int;

set i = 0;

while(i < 1000000000) do
set i = i+1;
insert into test_table values(i);
end while;
end;
//

delimiter ;
call sp4();

Sunday, March 15, 2009

Merging two files line by line on unix/linux

Source
for eample
file1:
2 3 0
6 2 0
2 3 1
5 3 1
6 9 1file2
2 2 2
2 2 2
paste -d " " file1 file2 >"outputfile1"
outputfile1
2 3 0 2 2 2
6 2 0 2 2 2
2 3 1
5 3 1
6 9 1

Blog Archive