Click here to Skip to main content
15,909,440 members
Home / Discussions / Database
   

Database

 
QuestionGet Previous number Pin
SatyaKeerthi1526-Jul-10 21:00
SatyaKeerthi1526-Jul-10 21:00 
AnswerRe: Get Previous number Pin
Mycroft Holmes26-Jul-10 21:41
professionalMycroft Holmes26-Jul-10 21:41 
Questionalternative to rewire CASE WHEN in query Pin
prachidalwadi25-Jul-10 19:28
prachidalwadi25-Jul-10 19:28 
AnswerRe: alternative to rewire CASE WHEN in query Pin
Herman<T>.Instance26-Jul-10 3:55
Herman<T>.Instance26-Jul-10 3:55 
AnswerRe: alternative to rewire CASE WHEN in query Pin
scottgp26-Jul-10 6:06
professionalscottgp26-Jul-10 6:06 
GeneralRe: alternative to rewire CASE WHEN in query Pin
prachidalwadi26-Jul-10 17:12
prachidalwadi26-Jul-10 17:12 
GeneralRe: alternative to rewire CASE WHEN in query Pin
scottgp27-Jul-10 1:40
professionalscottgp27-Jul-10 1:40 
GeneralRe: alternative to rewire CASE WHEN in query Pin
prachidalwadi3-Aug-10 19:36
prachidalwadi3-Aug-10 19:36 
Scott,
here is the whole query.
and roughly, records for each supplier is minimum 400(rows)

declare @a as char(1)
declare @b as varchar(35)
set @a='Y'
set @b='<span style=''color:Red''>N</span>'
SELECT DISTINCT
Product_Master.Product_Kid, Product_Master.Product_Name, convert(nvarchar,Product_Master.Product_RegDate,103) as Product_RegDate, Product_Master.Product_RegDate as RegDate,
Isnull(Product_Master.Product_Code,'-') AS Product_Code,
Isnull(Product_Master.Product_ModelNo,'-') AS Product_ModelNo,
CASE WHEN (Product_Master.Product_Image IS NULL) THEN @b ELSE @a END AS Product_Image,
CASE WHEN (Product_Master.Product_BrandId IS NULL) THEN @b ELSE @a END AS Brand_Name,
CASE WHEN (Product_Master.Product_MarketPrice IS NULL) THEN @b ELSE @a END AS Product_MarketPrice,
CASE WHEN (Product_Master.Product_PackagingCharge IS NULL) THEN @b ELSE @a END AS Product_PackagingCharge,
CASE WHEN (Product_Master.Product_MinOrderQty IS NULL) THEN @b ELSE @a END AS Product_MinOrderQty,
CASE WHEN (Product_Master.Product_ShippingQty IS NULL) THEN @b ELSE @a END AS Product_ShippingQty,
CASE WHEN (Product_Master.Product_Weight IS NULL) THEN @b ELSE @a END AS Product_Weight,
CASE WHEN (Product_Master.Product_Dimension IS NULL) THEN @b ELSE @a END AS Product_Dimension,
CASE WHEN (Product_Master.Product_DeliveryPeriod IS NULL) THEN @b ELSE @a END AS Product_DeliveryPeriod,
CASE WHEN (Product_Master.Product_Description Is NULL) THEN @b ELSE @a END AS Product_Description,
CASE WHEN (Product_Master.Product_PcsPerKg IS NULL) THEN @b ELSE @a END AS Product_PcsPerKg,
CASE WHEN (ProductApplication.ProdApp_Code IS NULL) THEN @b ELSE @a END AS ProdApp_Code,
CASE WHEN (ProductFeatures.ProdFeatures_Code IS NULL) THEN @b ELSE @a END AS ProdFeatures_Code,
CASE WHEN (ProductTechnicalSpecification.TechSpec_code IS NULL) THEN @b ELSE @a END AS TechSpec_code,
CASE WHEN (ProductSpecialNotesInstruction.ProdSpecInstr_Code IS NULL) THEN @b ELSE @a END AS ProdSpecInstr_Code,
CASE WHEN (MaterialSafetyDataSheet.MSDS_Code IS NULL) THEN @b ELSE @a END AS MSDS_Code,
CASE WHEN (ProductStandardApproval.ProdStdApproval_Code IS NULL) THEN @b ELSE @a END AS ProdStdApproval_Code,
CASE WHEN (InstallationManual.InstCommManual_Code IS NULL) THEN @b ELSE @a END AS InstCommManual_Code,
CASE WHEN (ProductPackaging.ProdPackaging_Code IS NULL) THEN @b ELSE @a END AS Product_PackagingCode,
CASE WHEN (ProductInstallationCommissioning.InstallationComm_Code IS NULL) THEN @b ELSE @a END AS InstallationComm_Code,
CASE WHEN (Catalog.Catalog_code IS NULL) THEN @b ELSE @a END AS Catalog_code,
CASE WHEN (Product_GuarantyWarrantydetails.gwd_Code IS NULL) THEN @b ELSE @a END AS gwd_Code,
CASE WHEN (OtherDetail_SpareParts.ODTSP_code IS NULL) THEN @b ELSE @a END AS Spares_Code,
CASE WHEN (OtherDetail_IncludedAccessories.ODTIA_code IS NULL) THEN @b ELSE @a END AS AccessoriesIncluded_Code,
CASE WHEN (OtherDetail_OptionalAccessories.ODTOA_code IS NULL) THEN @b ELSE @a END AS AccessoriesOptional_Code,
CASE WHEN (WearAndTearParts.WearAndTearPart_Code IS NULL) THEN @b ELSE @a END AS WearAndTearPart_Code,
CASE WHEN (Consumables.c_code IS NULL) THEN @b ELSE @a END AS C_Code
FROM Product_Master LEFT JOIN
WearAndTearParts ON Product_Master.Product_Kid = WearAndTearParts.WearAndTearPart_ProductId LEFT JOIN
OtherDetail_OptionalAccessories ON Product_Master.Product_Kid = OtherDetail_OptionalAccessories.ODTOA_ProductId LEFT JOIN
OtherDetail_IncludedAccessories ON Product_Master.Product_Kid = OtherDetail_IncludedAccessories.ODTIA_ProductId LEFT JOIN
OtherDetail_SpareParts ON Product_Master.Product_Kid = OtherDetail_SpareParts.ODTSP_ProductId LEFT JOIN
ProductInstallationCommissioning ON Product_Master.Product_Kid = ProductInstallationCommissioning.InstallationComm_ProductId LEFT JOIN
ProductPackaging ON Product_Master.Product_Kid = ProductPackaging.ProdPackaging_ProductId LEFT JOIN
InstallationManual ON Product_Master.Product_Kid = InstallationManual.InstCommManual_ProductId LEFT JOIN
ProductStandardApproval ON Product_Master.Product_Kid = ProductStandardApproval.ProdStdApproval_ProductId LEFT JOIN
MaterialSafetyDataSheet ON Product_Master.Product_Kid = MaterialSafetyDataSheet.MSDS_ProductId LEFT JOIN
ProductSpecialNotesInstruction ON Product_Master.Product_Kid = ProductSpecialNotesInstruction.ProdSpecInstr_ProductId LEFT JOIN
ProductTechnicalSpecification ON Product_Master.Product_Kid = ProductTechnicalSpecification.TechSpec_ProductId LEFT JOIN
Product_GuarantyWarrantydetails ON Product_Master.Product_Kid = Product_GuarantyWarrantydetails.gwd_ProductId LEFT JOIN
ProductFeatures ON Product_Master.Product_Kid = ProductFeatures.ProdFeatures_ProductId LEFT JOIN
ProductApplication ON Product_Master.Product_Kid = ProductApplication.ProdApp_ProductId LEFT JOIN
[Catalog] ON Product_Master.Product_Kid = Catalog.Catalog_productid LEFT JOIN
Consumables ON Product_Master.Product_Kid = Consumables.c_productid
WHERE Product_Master.Product_Isdeleted = '0'
AND Product_Master.Product_SupplierId = '00000273V'
ORDER BY RegDate DESC

select * from supplier_master
GeneralRe: alternative to rewire CASE WHEN in query Pin
Herman<T>.Instance28-Jul-10 3:38
Herman<T>.Instance28-Jul-10 3:38 
AnswerRe: alternative to rewire CASE WHEN in query Pin
PIEBALDconsult26-Jul-10 8:05
mvePIEBALDconsult26-Jul-10 8:05 
AnswerRe: alternative to rewire CASE WHEN in query Pin
Jörgen Andersson27-Jul-10 21:31
professionalJörgen Andersson27-Jul-10 21:31 
QuestionMessage Removed Pin
25-Jul-10 1:24
bapu288925-Jul-10 1:24 
AnswerRe: SQL INSERT ISSUE Pin
Matt U.25-Jul-10 6:23
Matt U.25-Jul-10 6:23 
AnswerRe: SQL INSERT ISSUE Pin
Stoffy197225-Jul-10 7:13
Stoffy197225-Jul-10 7:13 
QuestionRe: SQL INSERT ISSUE Pin
bapu288925-Jul-10 21:15
bapu288925-Jul-10 21:15 
AnswerRe: SQL INSERT ISSUE Pin
PIEBALDconsult26-Jul-10 8:24
mvePIEBALDconsult26-Jul-10 8:24 
AnswerRe: SQL INSERT ISSUE Pin
Stoffy197226-Jul-10 8:35
Stoffy197226-Jul-10 8:35 
GeneralRe: SQL INSERT ISSUE Pin
bapu288926-Jul-10 21:23
bapu288926-Jul-10 21:23 
AnswerHow to ask a question Pin
Luc Pattyn26-Jul-10 23:34
sitebuilderLuc Pattyn26-Jul-10 23:34 
QuestionInstall SQL 2008 r2 express with my application Pin
bonzaiholding24-Jul-10 22:29
bonzaiholding24-Jul-10 22:29 
AnswerRe: Install SQL 2008 r2 express with my application Repost Pin
Richard MacCutchan25-Jul-10 1:40
mveRichard MacCutchan25-Jul-10 1:40 
Answercross-post Pin
Luc Pattyn25-Jul-10 2:18
sitebuilderLuc Pattyn25-Jul-10 2:18 
Question[MS SQL SERVER] Create constraints in a cyclic relations Pin
Lutosław23-Jul-10 23:32
Lutosław23-Jul-10 23:32 
Questionanother query Pin
reza assar23-Jul-10 21:40
reza assar23-Jul-10 21:40 
AnswerRe: another query Pin
Goutam Patra23-Jul-10 22:58
professionalGoutam Patra23-Jul-10 22:58 

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.