Tuesday, February 14, 2012

mysql drop Foreign Keys

mysql> alter table sig_dumps drop foreign key sig_dumps_ibfk_1;
Query OK, 8 rows affected (0.23 sec)
Records: 8 Duplicates: 0 Warnings: 0

mysql min max in condition

mysql> select profile_id, min(date(created_on)), max(date(created_on)) from sig_dumps group by profile_id having min(date(created_on))!= max(date(created_on)) ;
+------------+-----------------------+-----------------------+
| profile_id | min(date(created_on)) | max(date(created_on)) |
+------------+-----------------------+-----------------------+
| 3 | 2012-02-07 | 2012-02-14 |
| 4 | 2012-02-07 | 2012-02-14 |
| 5 | 2012-02-07 | 2012-02-14 |
| 9 | 2012-02-07 | 2012-02-14 |
+------------+-----------------------+-----------------------+
4 rows in set (0.00 sec)

Saturday, February 11, 2012

shell script math operation add times etc

#!/bin/bash

count=0

for (( i=36 ; i<=61; i++ ))
do
for (( j=0; j<10; j++))
do
let "count++"
echo $count
let "page=$j * 100"
echo $page
filename="http://www.abc.com/t_${i}_${page}_EN.htm"
echo $filename
wget "$filename" --output-document=html/${count}.html

done
done

Tuesday, February 7, 2012

wget rename file name

wget "http://mastersearch.abc.com/servlet/org.dbcreator.MainServlet?query=uformat=ccd&options=brandqtyoffercrm" --output-document=11.html

wget https://www.google.com/ --output-document=111.html

Thursday, February 2, 2012

shell script for loop

#!/bin/bash

for (( j = 0 ; j <= 186; j++ )) ### Inner for loop ###
do
php ChemLookup_CAS_GSM.php $j
done

Friday, January 20, 2012