Viewing 9 posts - 1 through 9 (of 9 total)
CREATE PROCEDURE AdjustPrice
(
@pItemDesc VARCHAR(1000),
@pPercent NUMERIC(18,2)
)
AS
SET NOCOUNT ON
BEGIN
UPDATE Item
...
September 17, 2014 at 4:38 am
select b.isbn,b.title,b.publishername from book b INNER JOIN
(
SELECT title, publishername,COUNT(*) count FROM book
GROUP BY title , publishername
HAVING COUNT(*)>2
)t
on b.title=t.title and b.publishername=t.publishername
September 12, 2014 at 6:59 am
DECLARE @temptbl AS TABLE
(
Field1 INT,
Field2 INT,
Field3 VARCHAR(20),
Field4 VARCHAR(10)
)
Insert into @temptbl
select 32,375,'abc-xyz','A' UNION ALL
select 32,379,'xyz-efg','A' UNION ALL
select 55,405,'abc-xyz','B' UNION ALL
select 55,407,'xyz-efg','B' UNION ALL
select 132,908,'abc-xyz','C' UNION ALL
select 132,999,'xyz-efg','C' UNION ALL
select 152,800,'abc-xyz','D' UNION...
September 12, 2014 at 6:40 am
declare @cust table(custID int, name varchar(15))
declare @order table(orderid int, custid int, orderNum varchar(15),orderdate datetime)
declare @orderdetail table(orderDetid int, orderid int, itemnum varchar(10),Itemcnt int,amt int)
insert into @cust(custID,name)
values (1,'CustOne'),(2,'CustTwo')
insert into @order (orderid,custid,orderNum,orderdate)
values...
September 9, 2014 at 11:14 pm
select * from
(
select ROW_NUMBER()over(Partition by coveragecode) rowno,* from Contract
)t
where rowno<=5
September 3, 2014 at 6:22 am
IF OBJECT_ID('tempdb..#test') IS NOT NULL
DROP TABLE #test
---- create table
create table #test(sid bigint, scode nvarchar(50), parentid bigint, sname nvarchar(50))
---- insert records
insert into #test values (1, '11', 0, 'a')
insert into #test...
September 1, 2014 at 12:57 am
SELECT *,DENSE_RANK() OVER(ORDER BY COL3) 'My Number' FROM MyTable
August 25, 2014 at 12:00 am
Viewing 9 posts - 1 through 9 (of 9 total)