/****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP 300 [id_row]
      ,[id_user]
      ,[user_name]
      ,[password]
      ,[nama]
      ,[id_dept]
      ,[tingkat]
      ,[jabatan]
      ,[id_jabatan]
      ,[status]
      ,[create_by]
      ,[create_date]
      ,[change_by]
      ,[change_date]
      ,[bisa_pilih]
      ,[bisa_upload]
      ,[bisa_hapus]
      ,[bisa_ref]
  FROM [WebBranches].[dbo].[user]
WHERE
  nama LIKE '%nurul%'

SELECT id_transaction_type, description FROM transaction_type WHERE id_transaction_type IN (SELECT id_transaction_type FROM dbo.func_user_trans_type_permission('7NH')) AND status='I' ORDER BY DESCRIPTION

SELECT * FROM
	dbo.web_menu_group

  SELECT 
    id_menu_group,
    *
  FROM 
    web_user_menu
  WHERE
    id_user = 'ABD'
    
  SELECT 
    id_menu_group,
    *
  FROM 
    web_user_menu
  WHERE
    id_user = '7NH'
  
  SELECT
    DISTINCT
    id_transaction_type
  FROM 
    trans_type_permission
  WHERE
    id_user = '7NH'
    OR id_group = 5
  ORDER BY id_transaction_type
  
SELECT
	*
FROM
	trans_type_permission
WHERE
  id_group IN (4,5)
ORDER BY
  id_group,id_transaction_type

--INSERT INTO dbo.trans_type_permission
--        (id_group,
--         id_user,
--         id_transaction_type)
--SELECT
--	  4,
--	  id_user,
--	  id_transaction_type
--FROM
--	trans_type_permission
--WHERE
--  id_group = 5
--  AND id_transaction_type NOT IN (SELECT id_transaction_type FROM dbo.trans_type_permission WHERE id_group = 4)