Reply to Re: Conditional query results

Your name:

Reply:


Posted by ElFroggio on 12/19/06 22:00

msrviking@gmail.com wrote:
> Hello everybody,
>
> After several attempts of writing the query, I had to post my
> requirement in the forum.
>
> Here is what I have, what I need and what I did.
>
> Table A
> Col1 Col2
> 1 Nm1
> 2 Nm2
> 3 Nm3
>
> Table B
> Col1 Col2
> 10 100
> 20 200
>
> Table C
> Col1 (A.Col1) Col2 (B.Col1)
> 1 10
> 2 10
>
> Table D
> Col1 (A.Col1) Col2
> 1 Value1
> 2 Value2
>
>
> I need results based on below criteria,
>
> 1.
> Criteria - B.Col2 = 100
> Resultset
> A.Col1 D.Col1
> 1 Value1
> 2 Value2
>
> 2.
> Criteria - B.Col2 =""
> A.Col1 D.Col1
> 1 Value1
> 2 Value2
> 3 NULL
>
> 3.
> Criteria - B.Col2 =200
> Empty resultset
>
> Here is the query I tried, but looks its not working. Probably there is
> a better way to do this.

see http://www.sqlhacks.com/index.php/Retrieve/Conditional-columns

[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

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