The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sybase and shell melanie_pfefer Shell Programming and Scripting 1 03-25-2008 07:02 PM
Need sybase sql command help jagdish.machhi@ UNIX for Advanced & Expert Users 4 02-20-2008 11:26 PM
Print out loop index on the console after executing each sybase DB query Alaeddin Shell Programming and Scripting 2 12-16-2007 04:30 AM
Dynamic update loop query on Sybase database Alaeddin Shell Programming and Scripting 10 12-13-2007 06:26 AM
Connect From VB to Sybase 11 Than Chanroeun SUN Solaris 2 08-18-2006 12:42 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-22-2008
chatieremerrill chatieremerrill is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 6
Need help with complex SQL query (Sybase)

Hello,

I have three tables.

I need an SQL query (preferably Sybase) that will return all of the stringID values of table B where the following conditions exist:

(1) B.intID = A.intID
(2) B.intID != C.intID
or (B.intID = C.intID and
(C.v1 = 0 or C.v2 = 0))

Here are the table defs:

create table A (
intID int
}

create table B (
intID int,
stringID varchar(15)
)

create table C (
stringID varchar(15),
v1 int,
v2 int
)

Thanks for any input,
Elizabeth
 

Bookmarks

Tags
query, sql, sybase

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:02 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0