Hi,I need to perform a query that will return the status of packlists.The query will be something like this:Select cartonstatus_id from carton C inner join CartonStatusHistory Hon C.carton_id=H.carton_id where packlist_id in (@packlist).I also have to join other tables in order to get data from other tables.However, I need to check per packlist if different status_ids are returned. If yes then i have to return the word 'Mixed' else the status_name.So if packlist_id has statuses 1,2 the status will actually be Mixed. Not sure what is the best way to write that query.Thanks for the help.CREATE TABLE [dbo].[Carton]( [carton_id] [nvarchar](255) , [packlist_id] [nvarchar](30) , [businessunit_id] [int] NOT NULL, [season_id] [int] NOT NULL, CONSTRAINT [PK_Carton] PRIMARY KEY CLUSTERED CREATE TABLE [dbo].[CartonStatusHistory]( [cartonstatushistory_id] [int] IDENTITY(1,1) NOT NULL, [cartonstatushistory_date] [smalldatetime] NOT NULL CONSTRAINT [DF_CartonStatusHistory_cartonstatushistory_date] DEFAULT (getdate()), [cartonstatus_id] [int] NOT NULL, [carton_id] [nvarchar](255) , [user_id] [int] NOT NULL, [message_id] [int] NULL, [cartonstatushistory_xmlsource_date] [smalldatetime] NULL
Whisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.