Re: Query Help
From: Joe Horton (horj235)
Date: 06/09/04
- Next message: Alex: "null = null with ansi_nulls off"
- Previous message: Anith Sen: "Re: Query Help"
- In reply to: Anith Sen: "Re: Query Help"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 9 Jun 2004 11:18:51 -0700
I created teh query and it works great - below is the code - I Just need to
change the dum column- it's sort of a Reverse Join scenario:
DECLARE @StatesCovered varchar(255), @dum varchar(255)
SELECT
@dum = 'Mycompany', @StatesCovered = COALESCE(@StatesCovered + ',', '') +
cast(x.enfact_osha_num AS varchar)
FROM
(SELECT z.enfact_osha_num FROM enfact z JOIN enreac k ON z.enfact_id =
k.enreac_related_enfact_id
WHERE k.enreac_del_date IS NULL AND k.enreac_enfact_id = 16206) AS x
SELECT @dum AS dum,
@tmp AS tmp
Returns:
dum tmp
MyCompany KY, NY, WA, FL
"Anith Sen" <anith@bizdatasolutions.com> wrote in message
news:u3OQi1kTEHA.3844@TK2MSFTNGP11.phx.gbl...
> There is no single SQL query which can accomodate such reporting
> requirements so it is generally recommended that you use a client side
> programming language or a report writer to develop such formatted results.
>
> Some options in SQL for such problems are discussed here:
>
http://groups.google.com/groups?selm=%23u19EkNHEHA.700%40TK2MSFTNGP09.phx.gbl
>
> --
> Anith
>
>
- Next message: Alex: "null = null with ansi_nulls off"
- Previous message: Anith Sen: "Re: Query Help"
- In reply to: Anith Sen: "Re: Query Help"
- Messages sorted by: [ date ] [ thread ]