Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #878

Re: is there a way to put a table into a parameter

From "Bob Barrows" <reb01501@NOyahooSPAM.com>
Newsgroups comp.databases.ms-sqlserver
Subject Re: is there a way to put a table into a parameter
Date 2011-12-21 14:08 -0500
Organization A noiseless patient Spider
Message-ID <jctas0$h5n$1@dont-email.me> (permalink)
References <7aa6e91d-24ac-4416-8d12-36cfcf89f8bb@i6g2000vbe.googlegroups.com>

Show all headers | View raw


Apsteinberg wrote:
> Hi,
>
> I am new to sql, been working in SAS for many years and my mind still
> is in the SAS thinking.  I have a table with NDC codes called
> interested_ndccodes and it looks like this (way to many values to
> code)
>
> ndc ndc_coding
> 123 ndc like '123%'
> 456 or ndc like '456%'
> 789 or ndc like '789%'
>
> Now I want to look for those ndc values in another table.  So if it
> was an ideal world the statement would be something simple like this,
> but its not:
> select * from pharm where(select * from interested_ndccodes)
>
> I know how I would handle it in SAS, but am coming up blank with
> google searches.
> Thanks for the help...I know I need to learn the basics which would
> give me the tools to know how to do this.

select * from pharm where fieldname in (select fieldname from
interested_ndccodes)

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

is there a way to put a table into a parameter Apsteinberg <apsteinberg@hotmail.com> - 2011-12-21 10:47 -0800
  Re: is there a way to put a table into a parameter "Bob Barrows" <reb01501@NOyahooSPAM.com> - 2011-12-21 14:08 -0500
    Re: is there a way to put a table into a parameter Erland Sommarskog <esquel@sommarskog.se> - 2011-12-21 23:34 +0100

csiph-web