Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 2nd, 2012, 11:21 AM
vmsteps vmsteps is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 2 vmsteps User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 50 sec
Reputation Power: 0
Exclamation Selecting fields between 2 tables

Hello All,

I am unsure how to approach this complicated dilemma
I have 2 tables that I constructed through sub selects. I want to pull all the fields in one table if the user input is a specific number and ignore the other table fields, and vice versa for the other table. Can this be done and if so how?

so far I have tried With statements, Unions I know will not work, and integrating the one query into the other won't make sense in the way that it is built...unless someone else can clarify.

Thanks in advance for any suggestions.

Reply With Quote
  #2  
Old August 2nd, 2012, 11:27 AM
vmsteps vmsteps is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 2 vmsteps User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 50 sec
Reputation Power: 0
*Portion of the code
bellow is similar to the other table it contains a derived table with ask for a link, but with a different CF.ID
(
SELECT CVL.INFO AS BOOKCOLLECTIONLINK,
CVL.RECORDID
FROM CUSTOMFIELD CF
INNER JOIN CUSTOMVARCHARLONG CVL ON
CVL.CUSTOMFIELDID = CF.ID
WHERE CF.ID = 36 --Field I want to make into a parameter to specify which table to use
AND CVL.INFO = ::LINK --User Input
) AS LINKPART ON

Reply With Quote
  #3  
Old August 9th, 2012, 03:06 PM
nagysz nagysz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 200 nagysz User rank is Sergeant (500 - 2000 Reputation Level)nagysz User rank is Sergeant (500 - 2000 Reputation Level)nagysz User rank is Sergeant (500 - 2000 Reputation Level)nagysz User rank is Sergeant (500 - 2000 Reputation Level)nagysz User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 11 h 19 m 28 sec
Reputation Power: 13
This doesn't seem to be complicsted with an SP, but maybe you don't even need SP just a correct WHERE condition.

But could you be more specific or give a real world example? So i'll correctly understand what you want.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Selecting fields between 2 tables

Developer Shed Advertisers and Affiliates



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap