You are here: Re: OT - an SQL question « PHP Programming Language « IT news, forums, messages
Re: OT - an SQL question

Posted by Shelly on 11/11/07 03:37

What the original coder was do was subselects. This is supported on MySQL
4.1 and above. The version on the server that it is being moved to is
4.0.27, so that is why it didn't work. For the one I posted, there was a
simple way of recoding it. As I progressed futher into it, there were more
complex cases that required a subselect. Otherwise, it required multiple,
separate queries. For example:

select
ID,
(select ArtistName from mARTISTS where tblMain.MnArtist1 =
mARTISTS.ArtistID) as Artist1,
MnArtist1Desc,
(select ArtistName from mARTISTS where tblMain.MnArtist2 =
mARTISTS.ArtistID) as Artist2,
MnArtist2Desc
from tblMain
where MnEvent = '22'
ORDER BY MnOrder

--
Shelly

 

Navigation:

[Reply to this 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

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