List:General Discussion« Previous MessageNext Message »
From:Søren Merser Date:March 5 2006 2:12pm
Subject:Help on sql statement (not MySQL specifik)
View as plain text  
Hi

Could someone please help me out here?

 TABLE:
RECNO    | ID       |        TYPE
---------------------------------
1                | 1        |    NULL
2                | 2        |    4                <-KEEP AS IS
3                | 2        |    6                <- DROP
4                | 3        |    NULL        <- KEEP AS IS
5                | 4        |    NULL        <-KEEP AS IS
6                | 5        |    1                <-NULL
7                | 5        |    3                <-DROP
8                | 6        |    7                <-NULL
9                | 6        |    3                <-DROP

 What I neede is a SQL statement that for a given value of TYPE, lets say 4,
 selects all the unique id's with TYPE = 4 when appropriate otherwise NULL

 like:

SOLUTION:
RECNO    | ID       |        TYPE
---------------------------------
1                | 1        |    NULL
2                | 2        |    4
3                | 3        |    NULL
4                | 4        |    NULL
5                | 5        |    NULL
6                | 6        |    NULL


 I know this isn't  MySQL specifik but hope for someones help anyway :-)
Sorry for any inconvenience this may course users of the list
Regards Soren

Thread
Help on sql statement (not MySQL specifik)Søren Merser5 Mar
  • Re: Help on sql statement (not MySQL specifik)Rhino5 Mar
    • Re: Help on sql statement (not MySQL specifik)Ronald J. Yacketta5 Mar
  • Re: Help on sql statement (not MySQL specifik)Søren Merser5 Mar
    • Re: Help on sql statement (not MySQL specifik)Michael Stassen5 Mar
  • Re: Help on sql statement (not MySQL specifik)Rhino5 Mar
    • Re: Help on sql statement (not MySQL specifik)Michael Stassen5 Mar
  • Re: Help on sql statement (not MySQL specifik)Rhino5 Mar
  • Re: Help on sql statement (not MySQL specifik)Rhino5 Mar
  • Re: Help on sql statement (not MySQL specifik)Søren Merser5 Mar
  • Re: Help on sql statement (not MySQL specifik)Rhino6 Mar