Click here to Skip to main content
15,904,638 members
Home / Discussions / Database
   

Database

 
Generalhide relation in parent table Pin
Anonymous2-Aug-04 23:43
Anonymous2-Aug-04 23:43 
Questionhow to connect Oracle Lite Database with ADO.NET ? Pin
manoj_mevada2-Aug-04 22:29
manoj_mevada2-Aug-04 22:29 
GeneralDataReader reading data from multiple tables Pin
abhishk2001@yahoo.com2-Aug-04 15:59
abhishk2001@yahoo.com2-Aug-04 15:59 
GeneralRe: DataReader reading data from multiple tables Pin
iamalik043-Aug-04 1:37
sussiamalik043-Aug-04 1:37 
Generalignore last one, this is the tsql puzzle Pin
partt2-Aug-04 8:43
partt2-Aug-04 8:43 
GeneralRe: ignore last one, this is the tsql puzzle Pin
Steven Campbell2-Aug-04 9:04
Steven Campbell2-Aug-04 9:04 
GeneralRe: ignore last one, this is the tsql puzzle Pin
partt2-Aug-04 9:35
partt2-Aug-04 9:35 
GeneralRe: ignore last one, this is the tsql puzzle Pin
partt2-Aug-04 11:22
partt2-Aug-04 11:22 
Still can't quite get it. Here's more detail.

tTesterUsage Table
------------------
TesterID | UsageID
------------------
856 | 97
856 | 98
900 | 97
900 | 102


tLuUsage Table
--------------------
UsageID | UsageIndex
--------------------
97 | 60001
98 | 60002
99 | 60003
100 | 60004
101 | 60005
102 | 60006

tUConsumer Table
---------------------------
CMCode | GeneralDescription
---------------------------
60001 | Reads Books
60002 | Reads Magazines
60003 | Reads Newspaper
60004 | Watches TV
60005 | Rents Movies
60006 | Movie Theatre

******************************************
* tLuUsage.UsageIndex = tUConsumer.CMCode*
******************************************

Desired Result Below when TesterID = '856':
-----------------------------
GeneralDescription | There
-----------------------------
Reads Books | True
Reads Magazines | True
Reads NewsPaper | False
Watches TV | False
Rents Movies | False
Movie Theatre | False


I've tried this below, still doesn't quite do it.

CREATE PROCEDURE usp_tp_GetConsUsage
@TesterID char(7)
AS
declare @Out table (There varchar(5), TesterID char(7))
insert into @Out
SELECT tUConsumer.CMCode as There, tTesterUsage.TesterID
FROM tTesterUsage inner JOIN
tLuUsage ON tTesterUsage.UsageID = tLuUsage.UsageID inner JOIN
tUConsumer ON tLuUsage.UsageIndex = tUConsumer.CMCode
where tTesterUsage.TesterID = @TesterID

SELECT distinct tUConsumer.GeneralDescription,
case when Gonz.There is null then 'False' else 'True' end as There
FROM tLuUsage inner JOIN
tUConsumer ON tLuUsage.UsageIndex = tUConsumer.CMCode inner join
tTesterUsage on tLuUsage.UsageID = tTesterUsage.UsageID left join
@Out Gonz on tTesterUsage.TesterID = Gonz.TesterID
GO
GeneralRe: ignore last one, this is the tsql puzzle Pin
Steven Campbell2-Aug-04 14:30
Steven Campbell2-Aug-04 14:30 
GeneralRe: ignore last one, this is the tsql puzzle Pin
partt3-Aug-04 4:00
partt3-Aug-04 4:00 
GeneralRe: ignore last one, this is the tsql puzzle Pin
partt3-Aug-04 5:13
partt3-Aug-04 5:13 
GeneralRe: ignore last one, this is the tsql puzzle Pin
Manu T8-Aug-04 20:53
sussManu T8-Aug-04 20:53 
Generaltsql query puzzle Pin
partt2-Aug-04 8:38
partt2-Aug-04 8:38 
GeneralRe: tsql query puzzle Pin
andyharman4-Aug-04 23:47
professionalandyharman4-Aug-04 23:47 
GeneralData Dictionary Pin
Britnt72-Aug-04 3:08
Britnt72-Aug-04 3:08 
Generallooping datatable Pin
robmays1-Aug-04 23:23
robmays1-Aug-04 23:23 
GeneralRe: looping datatable Pin
Steven Campbell2-Aug-04 14:32
Steven Campbell2-Aug-04 14:32 
GeneralRe: looping datatable Pin
robmays2-Aug-04 20:56
robmays2-Aug-04 20:56 
GeneralCollation name question... Pin
theJazzyBrain1-Aug-04 6:54
theJazzyBrain1-Aug-04 6:54 
GeneralRe: Collation name question... Pin
Thea Burger2-Aug-04 1:11
Thea Burger2-Aug-04 1:11 
QuestionDetecting overlapping date ranges - best strategy - help? Pin
Paul Evans1-Aug-04 5:38
Paul Evans1-Aug-04 5:38 
Generalhai Pin
Asha Rams31-Jul-04 22:32
Asha Rams31-Jul-04 22:32 
GeneralBTrieve 6.15 Pin
Mega131-Jul-04 18:05
Mega131-Jul-04 18:05 
GeneralRe: BTrieve 6.15 Pin
Mekong River1-Aug-04 4:07
Mekong River1-Aug-04 4:07 
GeneralSynchronizing tables Pin
winpiglet31-Jul-04 10:43
winpiglet31-Jul-04 10:43 

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.