473,327 Members | 2,103 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

SQL server

I have two table one is Invmaster and another one is Invreference, these two table are having 2 common columns i.e. New_code and oldcode. my problem is i want to select the newcode from invmaster table where oldcode of invreference table is null.


plz help me out and revert back ASAP
Nov 26 '07 #1
5 871
amitpatel66
2,367 Expert 2GB
I have two table one is Invmaster and another one is Invreference, these two table are having 2 common columns i.e. New_code and oldcode. my problem is i want to select the newcode from invmaster table where oldcode of invreference table is null.


plz help me out and revert back ASAP

Please POST the table structure for reference.
What is the primary-foreign key between the two tables?
Nov 26 '07 #2
Please POST the table structure for reference.
What is the primary-foreign key between the two tables?
Invmaster
mat_code ( PK)
mat_name
uom
remark
cre_by
cre_date

InvReference
mat_code (PK)
oldcode (PK)
loc_code (PK)
Nov 26 '07 #3
amitpatel66
2,367 Expert 2GB
Invmaster
mat_code ( PK)
mat_name
uom
remark
cre_by
cre_date

InvReference
mat_code (PK)
oldcode (PK)
loc_code (PK)
Try this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT * FROM invmaster WHERE mat_code IN (SELECT mat_code FROM invreference WHERE oldcode IS NULL)
  3.  
  4.  
Nov 26 '07 #4
Try this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT * FROM invmaster WHERE mat_code IN (SELECT mat_code FROM invreference WHERE oldcode IS NULL)
  3.  
  4.  
thnx a lot its working
Nov 26 '07 #5
amitpatel66
2,367 Expert 2GB
thnx a lot its working

You are welcome :)

Amit
Nov 26 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Phil | last post by:
I am using a Pascal like language (Wealth-Lab) on W2K and call this server: class HelloWorld: _reg_clsid_ = "{4E797C6A-5969-402F-8101-9C95453CF8F6}" _reg_desc_ = "Python Test COM Server"...
6
by: Nathan Sokalski | last post by:
I want to set up SQL Server on Windows XP Pro so that I can use the database capabilities of ASP and IIS. I am probably using some incorrect settings, but I am not sure what they are. Here is what...
9
by: Grim Reaper | last post by:
My work let me put SQL Server 7.0 Enterprise Edition on my laptop. I have never setup a server from the beginning, so I am a little new at creating server groups. Alright, I am trying to create...
0
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: ...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.