Hi
I have to add Disk capacity trending information to data. Need to add future dates with potential disk capacity based on past dates. I have created some dummy data as follows:
if object_id('tempdb..#dummytable') is not null drop table #dummytable
create table #dummytable
(
ServerName...
Hi I have the following data which i have scripted for your convenience:
if object_id('tempdb..#people') is not null drop table #people
create table #people
(
DOB datetime
)
insert into #people values('19630901')
insert into #people values('19640901')
insert into #people...
Hi
I am new to Oracle having a SQL Server background. I like the richness of Oracle, but I am stumped on how to create a stored procedure that selects the columns from a table.
Like this:
create or replace procedure "P1"
is
begin
select * from T;
end;
/
The code to create Table T is...
Hi
I would like to split a column containing comma-delimiter data into many columns.
e.g
TheFruit
Apple,Pear,Kiwifruit,Orange
to
Fruit1 Fruit2 Fruit3 Fruit4
Apple Pear Kiwifruit Orange
This is like a split function, but the results appear in columns not in rows...
Hi
I created the following code to show the code in my stored procedures:
set serveroutput ON
set feedback off
set linesize 200
set ver off
col name format A100 Heading 'List of Stored Procedures'
PROMPT
-- Show the list of stored procedures for the user name
SELECT distinct name
FROM...
Hi
I have a stored procedure that has a multi-value parameter. The parameter called GetFruitNames will have a value such as
'kiwifruit,pear,orange'
In the select statement I have the folowing
select
fruitnames
from fruit
where
fruitnames in (GetFruitNames)
The GetFruitNames...
Hi
I have some data on sheet1 that I want to insert into an oracle database.
I use excel 7 and the oracle version is 10.
Does someone have some example code that does this? Also, what reference libraries do I have to Tick
Than you for your help
Mark
Hi I have data in a table as follows:
ID Fruit
1 Apple
1 Pear
1 Orange
2 Apple
2 KiwiFruit
3 Banana
3 Grapes
I want the data to appear as follows:
1 Apple Pear Orange
2 Apple KiwiFruit Null
3...
Hi
I have a table that has rows which I want to convert to columns
e.g.
#Fruit
COL1
Apple
Pear
Orange
I want a table that has
COL1 COL2 COL3
Apple Pear Orange
The #Fruit table can have 3 or more rows.
The names of the fruit can differ
Can this be done?
Thank you
Mark
Hi I have a periods table that has the following:
#periods
PeriodStart PeriodStop
null 2008-08-30
null 2008-07-30
null 2008-06-30
I would like to see the following
PeriodStart PeriodStop
2008-07-31 2008-08-30
2008-07-01 2008-07-30...
Hi
My Manager wants a report that limits the records to a user.
So I would have the where clause of my query have the following:
where person like '%' + @LoginName + '%'
@loginName contains the username of the person who logged into windows. The AD username.
Is there a function that gives...
Hi I have to find if a date range is valid
Parameters
Start Date = 1 Sept 2008
End Date = 30 Sept 2008
Example 1 :
StartDate column value = 2 Sept 2008
EndDate column value = 10 September 2008
I want Example 1 to appear in the report
Example 2 :
StartDate Column value = 10 August 2008...
Hi I have been given stored procs that has some unusual code I have never seen before.
SELECT
o1.name,
o2.name,
p.firstname + ' ' + p.surname,
p.firstname + ' ' + p.surname + ', ' + o2.name,
d.decision_id,
rr.decision_id
FROM
{
oj
((((DECISION d
INNER JOIN PERSON p ON...
Hi I am new to Sql. Using Sql 2005. Is it possible to do this.
e.g
#Fruit
Name Fruit
Tom Apple
Tom Apple
Dick Orange
Dick Apple
Harry Orange
Harry Pear
#FruitCount
Name Apple Orange Pear
Tom...
Hi
I have a table with this
Activity ID
1 1
1 2
1 3
2 4
2 5
3 6
4 7
4 8
I want to see this
Activity ID
1 1,2,3
2 4,5
3 6
4 7,8
Each activity has the...
Hi
I have a period table as follows:
StartDate EndDate
1 Jan 2008 31 Jan 2008
1 Feb 2008 29 Feb 2008
1 Mar 2008 31 Mar 2008
1 Apr 2008 30 Apr 2008
I have a customer table as follows:
ID Name Date
1 Blogg 15 Jan 2008
2 Smith...
Hi
I have the following table
ID date
1 1 Jan 2008
2 2 Jan 2008
3 5 Jan 2008
I want to see the following:
ID date difference
1 1 Jan 2008 Null
2 2 Jan 2008 1
3 4 Jan 2008 2
i.e it finds the day difference...
Hi I have a table that has the following data:
Column1
Apple
Banana
Orange
Pear
Column1 is in alphabetical order
I would like the following:
Column1
Select All
Apple
Banana
Orange
Pear
Thank you
Mark
Hi I have a Table with this data
#Fruit
Apple
Pear
Orange
I would like a table that has the following
#Final
Apple, Pear, Orange
i.e changing a column to a single row.
Regards
Mark
Hi
I have a periods table with the following:
#Periods
EndDate DatePeriod
31 March 2008 1 March 2008 to 31 March 2008
30 April 2008 1 April 2008 to 30 April 2008
I have a customer table as follows:
#Customer
Type EndDate...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.