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.
| 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 FKcust_cont_pk NUMBER(38) NOT NULL Sequential numeric primary key for this entity. No Yes Nocont_guid VARCHAR2(38) NULL No No NoARCHIVED CHAR(1) NULL indicate this contact is archived or not - (T, F) value No No Noname VARCHAR2(128) NOT NULL Name of contact No No NoDESCRIPTION VARCHAR2(255) NULL Description of contact No No NoBEGIN_TIME DATE NULL Date and time that contact begin No No NoEND_TIME DATE NULL Date and time that contact end No No NoDURATION FLOAT NULL duration of contact No No Nocont_save CHAR(1) NULL Indicator for save contact. No No Nocont_discard CHAR(1) NULL Indicator for discard contact. No No NoCONT_INFO NUMBER(38) NOT NULL No No NoI__CREATED DATE NULL No No NoI__MODIFIED DATE NULL No No NoI__MODIFIER CHAR(12) NULL No No NoI__APPLICATION CHAR(12) NULL No No NoTable : TEMP2:---------------------------------------------------------Name Datatype Null Option Comment Physical Only Is PK Is FKcont_cat_fold_pk NUMBER(38) NOT NULL Sequential numeric primary key for this entity. No Yes Nocont_cat_type_pk NUMBER(38) NOT NULL Foreign key of associated contact category type. No No YesSUBFOLDER_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 NoPERSON_PK NUMBER(38) NULL Foreign key of associated person who created the contact category folder. No No Noname VARCHAR2(128) NOT NULL Name of this contact category folder. No No NoDESCRIPTION VARCHAR2(255) NULL Description of this contact category folder. No No NoCREATION_DATE DATE NOT NULL Date this contact folder was created. No No NoEXPIRATION_DAYS INTEGER NULL Number of days contacts should stay in this folder before they expire. No No NoMAX_UNREV_CONT NUMBER NULL Number of unreviewed contacts allow in this folder No No NoARCHIVE_DAYS INTEGER NULL days that contact stored No No NoARCHIVE_TYPE INTEGER NULL type of archive (1: Audio - 2: Video- 3: both) No No NoI__CREATED DATE NULL No No NoI__MODIFIED DATE NULL No No NoI__MODIFIER CHAR(12) NULL No No NoI__APPLICATION CHAR(12) NULL No No NoMAX_UNREVIEWED_TYPE INTEGER NULL Values for this column are: 0 - No Limit, 1 - Folder, 2 - Agent No No NoTable : Temp3--------------------------------------------------------Name Datatype Null Option Comment Physical Only Is PK Is FKcust_cont_pk NUMBER(38) NOT NULL Foreign key of associated customer contact. No Yes Yescont_cat_fold_pk NUMBER(38) NOT NULL Foreign key of associated contact category folder. No Yes YesREVIEWED CHAR(1) NOT NULL indicate if contact in this folder is reviewed or not - (T, F) value No No NoVISIBLE CHAR(1) NOT NULL indicate if contact in this folder is visible in UI or not - (T, F) value No No NoRESTORE_INFO NUMBER(38) NOT NULL No No NoI__CREATED DATE NULL No No NoI__MODIFIED DATE NULL No No NoI__MODIFIER CHAR(12) NULL No No NoI__APPLICATION CHAR(12) NULL No No NoI need it very urgentlyThanks |
|
|
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 Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
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 Kizerhttp://weblogs.sqlteam.com/tarad/
True enough but thisquote: 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 urgentBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
|
|
|
|