Click here to Skip to main content
15,923,273 members
Home / Discussions / Database
   

Database

 
GeneralRe: backup access database Pin
RichardGrimmer12-Aug-04 1:32
RichardGrimmer12-Aug-04 1:32 
GeneralSearching problem (serious!) Pin
RoyRose786-Aug-04 1:03
RoyRose786-Aug-04 1:03 
GeneralRe: Searching problem (serious!) Pin
Michael Potter6-Aug-04 4:21
Michael Potter6-Aug-04 4:21 
GeneralRe: Searching problem (serious!) Pin
RoyRose786-Aug-04 4:57
RoyRose786-Aug-04 4:57 
GeneralMultiple Conditionals Pin
Peter86753095-Aug-04 8:43
Peter86753095-Aug-04 8:43 
GeneralRe: Multiple Conditionals Pin
Mike Ellison5-Aug-04 13:11
Mike Ellison5-Aug-04 13:11 
GeneralRe: Multiple Conditionals Pin
EdbertP5-Aug-04 13:27
EdbertP5-Aug-04 13:27 
GeneralRe: Multiple Conditionals Pin
Peter86753099-Aug-04 4:57
Peter86753099-Aug-04 4:57 
GeneralMS SQL 7 Error Pin
payal sheth5-Aug-04 2:51
payal sheth5-Aug-04 2:51 
Generalcomparing memo fields in Access Pin
pankajdaga4-Aug-04 23:47
pankajdaga4-Aug-04 23:47 
GeneralCreating db table from DataTable Pin
matt cole3-Aug-04 2:23
matt cole3-Aug-04 2:23 
GeneralRe: Creating db table from DataTable Pin
Thea Burger3-Aug-04 3:09
Thea Burger3-Aug-04 3:09 
GeneralRe: Creating db table from DataTable Pin
matt cole3-Aug-04 19:08
matt cole3-Aug-04 19:08 
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 

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.