﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 7,2000 / T-SQL  / Coalesce on inner queries / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 24 May 2012 14:09:46 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Coalesce on inner queries</title><link>http://www.sqlservercentral.com/Forums/Topic852853-8-1.aspx</link><description>I'm assuming you didn't read that article. Ok, so based on that sample data, what do you want the query to return. (actual values please, not a description)</description><pubDate>Mon, 25 Jan 2010 01:06:09 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: Coalesce on inner queries</title><link>http://www.sqlservercentral.com/Forums/Topic852853-8-1.aspx</link><description>k my tables arepackage_event (Id int,name nvarchar(50),fk_event int)workscope_event (fk_user int,fk_event int)data : Package_Event[u]Fk_Package[/u],          [u]Fk_Event[/u]         1                                1         2                                2         3                                3         4                                4         5                                5         6                                6         6                                1 data : workscope_event[u]Fk_User[/u],        [u]Fk_Event[/u]1                                 11                                 21                                 3now if the user 1 logs in then the out put should be[u]Fk_Event[/u] ,        [u]Fk_Package[/u]        1                                               1        2                                               2        3                                               3for other users all the events and their packages should come.</description><pubDate>Mon, 25 Jan 2010 00:57:00 GMT</pubDate><dc:creator>Raghunath Garlapati</dc:creator></item><item><title>RE: Coalesce on inner queries</title><link>http://www.sqlservercentral.com/Forums/Topic852853-8-1.aspx</link><description>I'm assuming you didn't read that article. Table definitions, sample data and desired output please.</description><pubDate>Mon, 25 Jan 2010 00:38:01 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: Coalesce on inner queries</title><link>http://www.sqlservercentral.com/Forums/Topic852853-8-1.aspx</link><description>Hi,I have a table workscope_event where i will be having event id and user id mappings,say for user id --&amp;gt; 1 mapped to events 1,2,3 where i have total 10 eventsnow i need a query such that if user with Id 1 login to the system it should show only 1,2,3 events but if user with other id logs into the system it shud give all the 10 events.so as i told from workscope_events i will get mappings of user and event where i need to filter from event table with those events of workwscope_events depending on user login.</description><pubDate>Mon, 25 Jan 2010 00:31:16 GMT</pubDate><dc:creator>Raghunath Garlapati</dc:creator></item><item><title>RE: Coalesce on inner queries</title><link>http://www.sqlservercentral.com/Forums/Topic852853-8-1.aspx</link><description>Please post table definitions, sample data and desired output. Read this to see the best way to post this to get quick responses.[url]http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]If may also be worth reading [url]http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/[/url] and [url]http://sqlinthewild.co.za/index.php/2009/09/15/multiple-execution-paths/[/url]</description><pubDate>Mon, 25 Jan 2010 00:07:43 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>Coalesce on inner queries</title><link>http://www.sqlservercentral.com/Forums/Topic852853-8-1.aspx</link><description>Hi All,I have a where condition like where Fk_Event in (COALESCE((select fk_event from workscope_event where Fk_user=@userId),Fk_Event)))actually my requirement is ..if the user is having event it should get only those events other wise all the events.here the problem is i may get more than one fk_event from inner query , please tell me how can i solve this...Please try to avoid if else statements coz already my query is depending on so many conditions.</description><pubDate>Mon, 25 Jan 2010 00:00:48 GMT</pubDate><dc:creator>Raghunath Garlapati</dc:creator></item></channel></rss>
