Tuesday, February 7, 2017

oracle query: get rows number and create conditions

to create the conditions in which the same data does not need to be displayed but still display different data

example:
item code item name value reward total
001 pen 500 500 1000
001 pen 600 500 1100
001 pen 100 500 600

after query create:
select  Case When WO_ID > 1 Then '' Else item_code End As item_code,
  Case When WO_ID > 1 Then '' Else item_name End As item_name,
  Case When WO_ID > 1 Then 0 Else value End As value,
  Case When WO_ID > 1 Then 0 Else reward End As reward,
  Case When WO_ID > 1 Then value Else (value+reward) End As total
from (select
  item_code, item_name, value, reward,
  ROW_NUMBER() Over (Partition By item_code Order By item_code) As  WO_ID
from tabelx)

result:
item code item name value reward total
001 pen 500 500 1000


600
600


100
100

Tuesday, January 31, 2017

mysql query join rows into one

GROUP_CONCAT is nice function :)

example:
Select Group_Concat(Concat(Date_Format(x.mstDDate, '%d/%m/%Y'), '-', x.mstDSparepart,'-',x.mstDAttribute) Separator ';') From inv_masterdetail x Where x.mstID = a.mstID

Monday, January 9, 2017

Error 1079: Windows could not start the Security Center service on Local Computer

Step 1: Set the security center and its dependencies services to run under Local Service account.
a. Click Start, type services.msc and hit enter.
b. Double click on Security Center, click Log On tab.
c. Select "This account" click Browse button, type Local Service and click ok.
d. Type the password and confirm the password and click ok.

Thursday, January 5, 2017

Forgot password root mysql

step:
  1. goto xampp folder and open folder mysql
  2. and edit file resetroot.bat
  3. add text in line area (location your data):
mysql\bin\mysqld.exe --no-defaults --datadir=D:\xampplite\mysql\data --bind-address=127.0.0.1 --bootstrap --console --skip-grant-tables --skip-innodb --standalone resetroot.err 2>&1
IF ERRORLEVEL 1 GOTO FEHLER
GOTO KEINFEHLER

Resetting MySQL Root Password with XAMPP on Localhost

Steps:
  1. Open your phpMyadmin dashboard
  2. go to user accounts
  3. on the user section Get the root user and click [ Edit privileges ]
  4. in the top section you will find change password button [ click on it ]
  5. make a good pass and fill 2 pass field
  6. now hit the Go button
  7. now open your xampp dir ( c:/xampp )
  8. to phpMyadmin dir [C:\xampp\phpMyAdmin]
  9. open [ config.inc.php ] file with any text editor
  10. find [ $cfg['Servers'][$i]['auth_type'] = 'config'; ]line and replace 'config' to ‘cookie’
  11. go to [ $cfg['Servers'][$i]['AllowNoPassword'] = true; ] this line change ‘true’ to ‘false’
 last : save the file .