Click here to Skip to main content
15,900,258 members
Home / Discussions / Database
   

Database

 
AnswerVeiws ? Pin
David Mujica4-Aug-10 9:59
David Mujica4-Aug-10 9:59 
GeneralRe: Views ? Pin
Frygreen5-Aug-10 10:27
Frygreen5-Aug-10 10:27 
QuestionHelp with this Stored proc Pin
soorma4-Aug-10 5:20
soorma4-Aug-10 5:20 
QuestionConversion error in ms sql Pin
seeism3-Aug-10 22:43
seeism3-Aug-10 22:43 
AnswerRe: Conversion error in ms sql Pin
seeism3-Aug-10 23:19
seeism3-Aug-10 23:19 
QuestionMultiple Database Transaction Pin
dataminers3-Aug-10 21:46
dataminers3-Aug-10 21:46 
AnswerRe: Multiple Database Transaction [modified] Pin
Mrityunnjoy6-Aug-10 9:19
Mrityunnjoy6-Aug-10 9:19 
QuestionNew column retrival on Sql Pin
<<Tash18>>3-Aug-10 21:13
<<Tash18>>3-Aug-10 21: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 21:58
professionalGoutam Patra3-Aug-10 21:58 
GeneralRe: New column retrival on Sql Pin
<<Tash18>>3-Aug-10 22:12
<<Tash18>>3-Aug-10 22:12 
QuestionSanity Check : Anyone doing Linq to SQL under 4.0 framework and WCF? Pin
Michael Eber3-Aug-10 13:27
Michael Eber3-Aug-10 13:27 
QuestionA Secured Hotel Management System using Visual BAsic 2010 Pin
prog_mafia3-Aug-10 4:20
prog_mafia3-Aug-10 4:20 
AnswerRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
J4amieC3-Aug-10 4:43
J4amieC3-Aug-10 4:43 
GeneralRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Jason Vetter3-Aug-10 5:21
Jason Vetter3-Aug-10 5:21 
GeneralRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Simon_Whale3-Aug-10 5:29
Simon_Whale3-Aug-10 5:29 
GeneralRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
hairy_hats3-Aug-10 5:37
hairy_hats3-Aug-10 5:37 
GeneralRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
J4amieC3-Aug-10 6:02
J4amieC3-Aug-10 6:02 
GeneralRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Simon_Whale3-Aug-10 6:05
Simon_Whale3-Aug-10 6:05 
AnswerRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Simon_Whale3-Aug-10 5:28
Simon_Whale3-Aug-10 5:28 
AnswerRe: A Secured Hotel Management System using Visual BAsic 2010 PinPopular
dan!sh 3-Aug-10 5:29
professional dan!sh 3-Aug-10 5:29 
AnswerRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Smithers-Jones3-Aug-10 5:49
Smithers-Jones3-Aug-10 5:49 
AnswerRe: A Secured Hotel Management System using Visual BAsic 2010 Pin
Chris Meech3-Aug-10 8:54
Chris Meech3-Aug-10 8:54 
QuestionHow to get value from outer to inner SELECT Pin
Robert König3-Aug-10 1:59
Robert König3-Aug-10 1:59 
AnswerRe: How to get value from outer to inner SELECT Pin
Tim Carmichael3-Aug-10 5:27
Tim Carmichael3-Aug-10 5:27 
AnswerRe: How to get value from outer to inner SELECT Pin
Bernhard Hiller3-Aug-10 20:55
Bernhard Hiller3-Aug-10 20: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.