Click here to Skip to main content
15,903,854 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL tutorial Pin
firestoper18-Jul-07 17:17
firestoper18-Jul-07 17:17 
GeneralRe: SQL tutorial Pin
Sathesh Sakthivel18-Jul-07 17:26
Sathesh Sakthivel18-Jul-07 17:26 
GeneralRe: SQL tutorial Pin
Rob Graham19-Jul-07 3:42
Rob Graham19-Jul-07 3:42 
AnswerRe: SQL tutorial Pin
Sathesh Sakthivel18-Jul-07 17:10
Sathesh Sakthivel18-Jul-07 17:10 
GeneralRe: SQL tutorial Pin
firestoper18-Jul-07 17:24
firestoper18-Jul-07 17:24 
GeneralRe: SQL tutorial Pin
Sathesh Sakthivel18-Jul-07 17:27
Sathesh Sakthivel18-Jul-07 17:27 
AnswerRe: SQL tutorial Pin
Krish - KP18-Jul-07 17:25
Krish - KP18-Jul-07 17:25 
QuestionCan somebody write a stored proc for this problem please? Pin
rajugrover18-Jul-07 8:29
rajugrover18-Jul-07 8:29 
suppose I have a table like this
create table MyTable(
varchar(10) s1,
varchar(10) s2
)
let an example for data in MyTable be
s1 s2
------------------------------
manager1 null
manager2 null
clerk0_1 manager1
clerk1_1 manager1
clerk2_2 manager2
clerk3_1 clerk0_1
clerk4_1 clerk1_1
clerk5_2 clerk2_2
clerk6_1 clerk4_1

the table says that s1 is the boss of s2. if s1 does not have a boss then s2 is null.
(I wrote a skeleton sql statement so that you can easily understand, please can you write a proc or sql statement)

I want a SQL statement like this

select s1 from MyTabe [please fill in here] where s1 = 'manager1'

so that the query will return
s1
---------------
manager1
clerk0_1
clerk1_1
clerk3_1
clerk4_1
clerk6_1
I mean starting from manager1 select recursively down to the last leaf. It is like given a tree select the root and all its leaves and the leafs of that subleaf and so on until all is out. Please note that there is no fixed level. The query ends when all the sub leaves are displayed. Can you please do it please?
AnswerRe: Can somebody write a stored proc for this problem please? Pin
Colin Angus Mackay18-Jul-07 8:54
Colin Angus Mackay18-Jul-07 8:54 
GeneralRe: Can somebody write a stored proc for this problem please? Pin
originSH18-Jul-07 22:17
originSH18-Jul-07 22:17 
AnswerRe: Can somebody write a stored proc for this problem please? Pin
Pete O'Hanlon18-Jul-07 9:17
mvePete O'Hanlon18-Jul-07 9:17 
GeneralRe: Can somebody write a stored proc for this problem please? Pin
Paul Conrad18-Jul-07 9:38
professionalPaul Conrad18-Jul-07 9:38 
GeneralRe: Can somebody write a stored proc for this problem please? Pin
Pete O'Hanlon18-Jul-07 9:46
mvePete O'Hanlon18-Jul-07 9:46 
GeneralRe: Can somebody write a stored proc for this problem please? Pin
Paul Conrad18-Jul-07 12:11
professionalPaul Conrad18-Jul-07 12:11 
AnswerRe: Can somebody write a stored proc for this problem please? Pin
DQNOK18-Jul-07 11:54
professionalDQNOK18-Jul-07 11:54 
QuestionGetting registered for SQL Notifications Pin
~~~Johnny~~~18-Jul-07 6:51
~~~Johnny~~~18-Jul-07 6:51 
QuestionDeleting Records using two different Databases Pin
bwhittington18-Jul-07 5:18
bwhittington18-Jul-07 5:18 
AnswerRe: Deleting Records using two different Databases Pin
Pete O'Hanlon18-Jul-07 5:26
mvePete O'Hanlon18-Jul-07 5:26 
GeneralRe: Deleting Records using two different Databases Pin
bwhittington18-Jul-07 5:34
bwhittington18-Jul-07 5:34 
AnswerRe: Deleting Records using two different Databases Pin
Chris Rickard18-Jul-07 18:21
Chris Rickard18-Jul-07 18:21 
Questiondata storage & access of data in sqlserver Pin
Sandep H S18-Jul-07 4:35
Sandep H S18-Jul-07 4:35 
AnswerRe: data storage & access of data in sqlserver Pin
originSH18-Jul-07 4:45
originSH18-Jul-07 4:45 
QuestionData Bindings Pin
Rharzkie18-Jul-07 1:32
Rharzkie18-Jul-07 1:32 
AnswerRe: Data Bindings Pin
Colin Angus Mackay18-Jul-07 2:10
Colin Angus Mackay18-Jul-07 2:10 
GeneralRe: Data Bindings Pin
Mike Dimmick18-Jul-07 2:30
Mike Dimmick18-Jul-07 2:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.