Viewing 14 posts - 1 through 14 (of 14 total)
Then this will return only those students who had 5 AND 10 but not 15
create table student ( stdnt_id int, stdnt_name varchar(50),stdnt_activity SMALLINT )
go
INSERT INTO student
select 1, 'kiran', 5...
February 6, 2012 at 10:56 am
create table student ( stdnt_id int, stdnt_name varchar(50),stdnt_activity SMALLINT )
go
INSERT INTO student
select 1, 'kiran', 5 UNION ALL
select 1 ,'kiran', 10 UNION ALL
select 1 ,'kiran', 15 UNION ALL
select 2...
February 3, 2012 at 11:22 am
if you comment out the following words at the last line, you will see some results.
--and(log.name='My_login')
February 3, 2012 at 10:58 am
--create stored procedure sp_MSforeachdb
/*
* The following table definition will be created by SQLDMO at start of each connection.
* We don't create it...
September 14, 2010 at 12:49 pm
Check this link, it is for SQL server 2000
http://msdn.microsoft.com/en-us/library/cc296676(BTS.10).aspx
July 30, 2010 at 12:36 pm
Have you checked the msdn link below?
http://msdn.microsoft.com/en-us/library/aa560998(BTS.10).aspx
July 29, 2010 at 2:59 pm
You need to change: 'where places =' to 'where places in '
See example code below
--create table
create table busroute
(busno varchar(10),
places varchar(500))
--insert value
insert into busroute
select '12G', 'Kalaignar Nagar, Nesapaakam,...
July 29, 2010 at 2:37 pm
--declare a table variable
declare @intakesource_daily table
(scheduledTime datetime)
--insert a testing value
insert into @intakesource_daily(scheduledTime)
values ('2010-04-27 14:56:40.993')
--if the scheduledtime < getdate(),then print 'file is late'
IF EXISTS
(SELECT...
April 27, 2010 at 12:58 pm
create table #fruit
(id int, name varchar(50))
declare fruits cursor
read_only
for select distinct id from fruit
declare @id int
declare @value varchar(500)
open fruits
fetch next from fruits into @id
while (@@fetch_status<>-1)
begin
if (@@fetch_status<>-2)
begin
select @value...
October 14, 2009 at 2:01 pm
select stuff((select ', '+ name from fruit
order by ', ' +name
for xml path ('')), 1, 2, '')
--returns
Apple, Banana, Grape, Melon, Orange
October 14, 2009 at 1:04 pm
select stuff((select ', '+ name from fruit
order by ', ' +name
for xml path ('')), 1, 2, '')
--returns
Apple, Banana, Grape, Melon, Orange
October 14, 2009 at 1:04 pm
Statement A:
select myOrd.Order_No, myiT.Item_No, myOrd.Unique_ID as 'UniqueID'
FROM myOrders myOrd
JOIN myItems myiT
ON myOrd.Order_No = myiT.Order_No
Order BY myiT.Unique_ID desc
Statement B:
select myOrd.Order_No, myiT.Item_No, myOrd.Unique_ID as 'Unique_ID'
FROM myOrders myOrd
JOIN myItems myiT
ON myOrd.Order_No = myiT.Order_No...
April 17, 2008 at 7:28 am
Viewing 14 posts - 1 through 14 (of 14 total)