Reply to SQL Query Help

Your name:

Reply:


Posted by Will Chamberlain on 11/22/05 22:02

I am working on queries for a SQL database. I have much experience with
Access and am trying to ween myself off of it. The query I am working
on now is supposed to return a set of data like the following:

LatestVersion(Ver)/VersionUpdate(Update)/Location(SheetNumber)
A/aa1/3

This works fine except for some of the products in the database don't
have these values attributed to them. I am using the following SQL
query:

SELECT Max(COALESCE(Sheet.Ver, 'NONE')) AS MaxOfVer,
Max(COALESCE(Update.Update, 0)) AS MaxOfUpdate, Sheet.SheetNumber FROM
Drawings INNER JOIN (Update INNER JOIN
Sheet ON Update.RecordID = Sheet.RecordID) ON Drawings.Drawing =
Sheet.Drawing WHERE (Sheet.Drawing = 'XXXXX') AND
(Sheet.SheetType = 'SH') GROUP BY Sheet.Drawing, Sheet.SheetType,
Sheet.SheetNumber


How can I edit this string to return either all 3 of the fields I need,
or return all of 3 of the fields with value = NONE if there are no
results. Is it possible to wrap a COALESCE around the whole query
string?




*** Sent via Developersdex http://www.developersdex.com ***

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация