sql 事务中 有时候需要锁定某行,等事物完成后 释放此行。
使用 with(ROWLOCK,UpdLock) 锁定当前行。禁止读取,修改和删除
a 事务
ALTER PROCEDURE [dbo].[asuo]
AS
BEGIN
begin tran
SELECT TOP 1 * FROM dbo.JYQ_HLT_Order with(ROWLOC...
分类:
数据库 时间:
2015-05-06 13:25:30
阅读次数:
195
题目描述:
Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
For example:
Given binary tree {3,...
分类:
其他好文 时间:
2015-05-06 13:23:22
阅读次数:
121
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
题意:给一个有序的链表建立二叉搜索树。
思路:这里是先递归建立左子树,然后链表跟着移动,左子树建立完了,此时节点就到了根了,接着建立右子树。
/**
* Definit...
分类:
其他好文 时间:
2015-05-06 13:19:54
阅读次数:
85
Description
A university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into two subnetworks in order...
分类:
Web程序 时间:
2015-05-06 13:12:59
阅读次数:
108
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For e...
分类:
其他好文 时间:
2015-05-06 10:39:11
阅读次数:
127
在使用hive进行数据处理时,经常会用到group by语法,但对分组的操作,hive没有mysql支持得好:
group_concat([DISTINCT] 要连接的字段 [Order BY
ASC/DESC 排序字段] [Separator '分隔符'])
hive只有一个collect_set内置函数,返回去重后的元素数组,但我们可以通过编写UDAF,来实现这些功能。...
分类:
其他好文 时间:
2015-05-05 22:06:53
阅读次数:
524
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ 9 20
...
分类:
其他好文 时间:
2015-05-05 22:00:45
阅读次数:
178
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
题意:将一个有序数组变成二叉搜索树。
思路:简单的递归。
/**
* Definition for a binary tree node.
* public class TreeNode {...
分类:
其他好文 时间:
2015-05-05 21:59:06
阅读次数:
117
Problem:
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and retur...
分类:
其他好文 时间:
2015-05-05 19:36:52
阅读次数:
139
利用PHP生成唯一订单号,可用作于商城下单,以及和支付宝等第三方支付进行对接先来一段测试代码:$i = 10;while($i) { $no = build_order_no(); $uniqid = uniqid(); var_dump("$non$uniqidn"); ...
分类:
Web程序 时间:
2015-05-05 18:33:45
阅读次数:
171