Loading ...
Sorry, an error occurred while loading the content.

3022RE: [SQLQueriesNoCode] Re: SQL If statement????

Expand Messages
  • Stephen Russell
    Aug 4, 2007
      What have you tried? You have to supply something for your code base and we
      will help you finish it. Just telling us what you want us to do for you,
      well I'm sorry but your not learning anything. You have to show some of
      your work.




      Stephen Russell
      DBA / .Net Developer

      Memphis TN 38115
      901.246-0159

      "A good way to judge people is by observing how they treat those who can do
      them absolutely no good."
      ---Unknown

      HYPERLINK
      "http://spaces.msn.com/members/srussell/"http://spaces.msn.com/members/sruss
      ell/



      _____

      From: SQLQueriesNoCode@yahoogroups.com
      [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of sjcwhittle
      Sent: Wednesday, August 01, 2007 12:51 PM
      To: SQLQueriesNoCode@yahoogroups.com
      Subject: [SQLQueriesNoCode] Re: SQL If statement????



      Hi - Thankyou for the help

      basically I have a query that is looking for say X in table 1.

      If X is in table one, all is good. If it is not, I want the query to
      populate a Y. Is this possible?

      --- In HYPERLINK
      "mailto:SQLQueriesNoCode%40yahoogroups.com"SQLQueriesNoCode@-yahoogroups.-co
      m, srussell@... wrote:
      >
      > > hi,
      > >
      > > This is what I understand from your point. If I mis-understand
      or my point
      > > is not very clear then let me know and clarify your case with
      the
      > > example:
      > >
      > > I think you wanna result set; if Table A does not contain the
      reference
      > > then
      > > you want it to replace it with some other field.
      > >
      > > Now you can check it with the count of the result set and if
      count is zero
      > > then you can return the default values and if count is 1 or
      greater then
      > > you
      > > can return the actual values.
      >
      >
      >
      > Try either CASE or ISNULL for T-SQL substitutions as needed.
      >






      No virus found in this incoming message.
      Checked by AVG Free Edition.
      Version: 7.5.476 / Virus Database: 269.11.0/929 - Release Date: 7/31/2007
      5:26 PM



      No virus found in this outgoing message.
      Checked by AVG Free Edition.
      Version: 7.5.476 / Virus Database: 269.11.4/935 - Release Date: 8/3/2007
      5:46 PM



      [Non-text portions of this message have been removed]
    • Show all 9 messages in this topic