Click here to Skip to main content
15,849,768 members
Home / Discussions / Database
   

Database

 
AnswerVeiws ? Pin
David Mujica4-Aug-10 10:59
David Mujica4-Aug-10 10:59 
GeneralRe: Views ? Pin
Frygreen5-Aug-10 11:27
Frygreen5-Aug-10 11:27 
QuestionHelp with this Stored proc Pin
soorma4-Aug-10 6:20
soorma4-Aug-10 6:20 
QuestionConversion error in ms sql Pin
seeism3-Aug-10 23:43
seeism3-Aug-10 23:43 
AnswerRe: Conversion error in ms sql Pin
seeism4-Aug-10 0:19
seeism4-Aug-10 0:19 
QuestionMultiple Database Transaction Pin
dataminers3-Aug-10 22:46
dataminers3-Aug-10 22:46 
AnswerRe: Multiple Database Transaction [modified] Pin
Mrityunnjoy6-Aug-10 10:19
Mrityunnjoy6-Aug-10 10:19 
QuestionNew column retrival on Sql Pin
<<Tash18>>3-Aug-10 22:13
<<Tash18>>3-Aug-10 22:13 
Hi guys...

Actually i have a table called products which has 4 products in it say for example pepsi, miranda, coke and fanta. The table has two columns product id and productname as follows:
1 pepsi
2 miranda
3 coke
4 fanta
now i have another table called agent, which has 3 columns such as agentid, region, productid. Now each agentid has a region and productid assigned to it as follows:
1001 DXB 1
1001 AJM 4
1002 ABC 2
1003 XYZ 3
1003 DEF 4 and so on. now in my application i need to make use of a query which gives me a result of all the product name with status for any particular agent id, for example: for agentid 1001 the result should be
productname  status

pepsi        true
miranda      false
coke         false
fanta        true


the query i tried is :

select a.productname, status = case b.product_id 
when 1 then 'True' else 'False' 
when 2 then 'True' else 'False' 
when 3 then 'True' else 'False' 
when 4 then 'True' else 'False' end
from products a, agent b where a.productid = b.productid and agentid ='1001'


but doest work... any help is appreciated...
AnswerRe: New column retrival on Sql Pin
Goutam Patra3-Aug-10 22:58
professionalGoutam Patra3-Aug-10 22:58 
GeneralRe: New column retrival on Sql Pin
<<Tash18>>3-Aug-10 23:12
<<Tash18>>3-Aug-10 23:12 
QuestionSanity Check : Anyone doing Linq to SQL under 4.0 framework and WCF? Pin
Michael Eber3-Aug-10 14:27
Michael Eber3-Aug-10 14:27 
QuestionA Secured Hotel Management System using Visual BAsic 2010 Pin
prog_mafia3-Aug-10 5:20
prog_mafia3-Aug-10 5:20 
AnswerRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
J4amieC3-Aug-10 5:43
J4amieC3-Aug-10 5:43 
GeneralRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Jason Vetter3-Aug-10 6:21
Jason Vetter3-Aug-10 6:21 
GeneralRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Simon_Whale3-Aug-10 6:29
Simon_Whale3-Aug-10 6:29 
GeneralRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
hairy_hats3-Aug-10 6:37
hairy_hats3-Aug-10 6:37 
GeneralRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
J4amieC3-Aug-10 7:02
J4amieC3-Aug-10 7:02 
GeneralRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Simon_Whale3-Aug-10 7:05
Simon_Whale3-Aug-10 7:05 
AnswerRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Simon_Whale3-Aug-10 6:28
Simon_Whale3-Aug-10 6:28 
AnswerRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
dan!sh 3-Aug-10 6:29
professional dan!sh 3-Aug-10 6:29 
AnswerRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Smithers-Jones3-Aug-10 6:49
Smithers-Jones3-Aug-10 6:49 
AnswerRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Chris Meech3-Aug-10 9:54
Chris Meech3-Aug-10 9:54 
QuestionHow to get value from outer to inner SELECT Pin
Robert König3-Aug-10 2:59
Robert König3-Aug-10 2:59 
AnswerRe: How to get value from outer to inner SELECT Pin
Tim Carmichael3-Aug-10 6:27
Tim Carmichael3-Aug-10 6:27 
AnswerRe: How to get value from outer to inner SELECT Pin
Bernhard Hiller3-Aug-10 21:55
Bernhard Hiller3-Aug-10 21:55 

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.