Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SELECT STATEMENT

Author  Topic 

romy
Starting Member

6 Posts

Posted - 2007-05-01 : 19:16:06
Hi,

I want sql statement to get name and cont_guid from union of tables below where cont_guid should match value (where I will pass variable)

Below are table:

Table : TEMP1:
-----------------------------------------------
Name Datatype Null Option Comment Physical Only Is PK Is FK
cust_cont_pk NUMBER(38) NOT NULL Sequential numeric primary key for this entity. No Yes No
cont_guid VARCHAR2(38) NULL No No No
ARCHIVED CHAR(1) NULL indicate this contact is archived or not - (T, F) value No No No
name VARCHAR2(128) NOT NULL Name of contact No No No
DESCRIPTION VARCHAR2(255) NULL Description of contact No No No
BEGIN_TIME DATE NULL Date and time that contact begin No No No
END_TIME DATE NULL Date and time that contact end No No No
DURATION FLOAT NULL duration of contact No No No
cont_save CHAR(1) NULL Indicator for save contact. No No No
cont_discard CHAR(1) NULL Indicator for discard contact. No No No
CONT_INFO NUMBER(38) NOT NULL No No No
I__CREATED DATE NULL No No No
I__MODIFIED DATE NULL No No No
I__MODIFIER CHAR(12) NULL No No No
I__APPLICATION CHAR(12) NULL No No No


Table : TEMP2:
---------------------------------------------------------
Name Datatype Null Option Comment Physical Only Is PK Is FK
cont_cat_fold_pk NUMBER(38) NOT NULL Sequential numeric primary key for this entity. No Yes No
cont_cat_type_pk NUMBER(38) NOT NULL Foreign key of associated contact category type. No No Yes
SUBFOLDER_PK NUMBER(38) NULL Foreign key reference to folder for which this folder is a sub-folder. This is also a recursive relationship on this entity. No No No
PERSON_PK NUMBER(38) NULL Foreign key of associated person who created the contact category folder. No No No
name VARCHAR2(128) NOT NULL Name of this contact category folder. No No No
DESCRIPTION VARCHAR2(255) NULL Description of this contact category folder. No No No
CREATION_DATE DATE NOT NULL Date this contact folder was created. No No No
EXPIRATION_DAYS INTEGER NULL Number of days contacts should stay in this folder before they expire. No No No
MAX_UNREV_CONT NUMBER NULL Number of unreviewed contacts allow in this folder No No No
ARCHIVE_DAYS INTEGER NULL days that contact stored No No No
ARCHIVE_TYPE INTEGER NULL type of archive (1: Audio - 2: Video- 3: both) No No No
I__CREATED DATE NULL No No No
I__MODIFIED DATE NULL No No No
I__MODIFIER CHAR(12) NULL No No No
I__APPLICATION CHAR(12) NULL No No No
MAX_UNREVIEWED_TYPE INTEGER NULL Values for this column are: 0 - No Limit, 1 - Folder, 2 - Agent No No No


Table : Temp3
--------------------------------------------------------
Name Datatype Null Option Comment Physical Only Is PK Is FK
cust_cont_pk NUMBER(38) NOT NULL Foreign key of associated customer contact. No Yes Yes
cont_cat_fold_pk NUMBER(38) NOT NULL Foreign key of associated contact category folder. No Yes Yes
REVIEWED CHAR(1) NOT NULL indicate if contact in this folder is reviewed or not - (T, F) value No No No
VISIBLE CHAR(1) NOT NULL indicate if contact in this folder is visible in UI or not - (T, F) value No No No
RESTORE_INFO NUMBER(38) NOT NULL No No No
I__CREATED DATE NULL No No No
I__MODIFIED DATE NULL No No No
I__MODIFIER CHAR(12) NULL No No No
I__APPLICATION CHAR(12) NULL No No No


I need it very urgently

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-05-01 : 19:26:19
quote:
Originally posted by romy


I need it very urgently



Your post is not readable, and it is not clear.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-05-02 : 08:55:46
quote:
Originally posted by tkizer

quote:
Originally posted by romy


I need it very urgently



Your post is not readable, and it is not clear.

Tara Kizer
http://weblogs.sqlteam.com/tarad/



True enough but this

quote:


I want sql statement to get name and cont_guid from union of tables below where cont_guid should match value (where I will pass variable)



Sounds like you want a join, not a union...never mind the fact that the col you mention doesn't exists, and the fact this looks like data dictionary stuff...so I don't know what's so urgent



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -