subquery

search for more blogs here

 

"Re: How to program this subquery?" posted by ~Ray
Posted on 2007-12-09 13:36:34

About db2-lDB2-L is your do peer-to-peer resource for objective technical discussion on DB2. decrease your project's research and development time. enter today to join this remove telecommunicate based discussion assort. Ignore this text box. It is used to detect spammers. If you enter anything into this text box no examine results will be displayed. do by this text box. It is used to sight spammers. If you register anything into this text box no examine results will be displayed. How about something like: select a key1 a key2 a month from my table a ,table (select b key1 b key2 b month from my delay b where b. Indication = 'j' and b month = (select min(c month) from my delay c where c key1 = b key1 and c key2 = b key2 and c indication = j) where a key1 = b key1 and a key2 = b key2 and a month >= b month The information entered on this page is required only to route your communicate to the allot people. It will not be used to send unsolicited email and will not be sold to a 3rd party. Please to construe our detailed privacy policy. How about something desire: select a key1 a key2 a month from my delay a ,table (select b key1 b key2 b month from my table b where b. Indication = 'j' and b month = (select min(c month) from my table c where c key1 = b key1 and c key2 = b key2 and c indication = j) where a key1 = b key1 and a key2 = b key2 and a month >= b month You must be logged in to use the Blog-to-ITtoolbox Journal feature. gratify or for an ITtoolbox account. You will be returned to this page after logging in. Copyright © 1998-2007 Information Technology Toolbox. Inc. All product names are trademarks of their respective companies. Information Technology Toolbox. Inc is not affiliated with or endorsed by any company listed at this site.

Forex Groups - Tips on Trading

Related article:
http://db.ittoolbox.com/groups/technical-functional/db2-l/1678586&rss=1

comments | Add comment | Report as Spam


"SubQuery Problem" posted by ~Ray
Posted on 2007-11-27 20:39:03

I have two queries one based on another. The first query is this. And is called "QHasChecks"decide tblChecksTMP. ChkTabID tblChecksTMP. ChkPaid tblChecksTMP. ChkServer tblChecksTMP. ChkPrinted tblChecksTMP. ChkDividedCheck tblChecksTMP. ChkTypeID tblChecksTMP. ChkCancelledFROM tblTabs INNER JOIN tblChecksTMP ON tblTabs. TabID = tblChecksTMP. ChkTabIDWHERE (((tblChecksTMP. ChkPaid)=0) AND ((tblChecksTMP. ChkPrinted)=0) AND ((tblChecksTMP. ChkDividedCheck)=0) AND ((tblChecksTMP. ChkTypeID) Not desire 5) AND ((tblChecksTMP. ChkCancelled)=0));The back up query is this. SELECT tblEmployees. EmployeeID. [EmpFirstName] & " " & [EmpLastName] AS SRVFROM QHasChecks INNER JOIN tblEmployees ON QHasChecks. ChkServer=tblEmployees. EmployeeIDGROUP BY tblEmployees. EmployeeID. [EmpFirstName] & " " & [EmpLastName]ORDER BY [EmpFirstName] & " " & [EmpLastName];I be to replace the first querys references in the back up ask with SQL code how would I do this?ThanksDS. .. The first query won't return the expected results you are looking for sine.. you are essentially returning the same information and just calling it... The way thedata is stored in the History delay each... | inner connect SMS_GH_System_COMPUTER_SYSTEMon... (microsoft public sms misc) .. >Create a form with you dropdown (Listbox) and After modify run your macro... >The action ordain be your first ask second query etc. Close your form. ... (microsoft public find queries)

Forex Groups - Tips on Trading

Related article:
http://www.tech-archive.net/Archive/Access/microsoft.public.access.queries/2007-11/msg00913.html

comments | Add comment | Report as Spam


"Referencing records in a subquery returned as part of a queryResult" posted by ~Ray
Posted on 2007-11-17 15:51:43

I need to access task information that is returned (via a subquery) as part of a lead ask. I'm calling this query statement (using the 10.0 connection js code): sforce connection ask("decide Id. Lead_Received__c. (Select Id. CreatedDate from Tasks) from bring about where Id = '{!Lead. Id}'"); The queryResult contains the change by reversal information (no errors) but I don't know how to reference the subquery records. Here's an outline of the code I'm using to work with the bring about records: if (queryResult size > 0) { var records = queryResult getArray('records'); for (var i = 0; i < records length; i++) { var lead = records[i]; // create fields from the bring about record; // want to output fields from each associated assign preserve // how do I reference them? }} else {// do nothing;} Thanks in advance for any assistance!Greg normally i put a breakpoint in the code using debugger;then run firefox with firebug installednow i can stop at that point and examine the local var "lead"it ordain have an object member that holds the query result for the related tasks something like this shoudl workvar thetasks = lead. Tasks getArray('records');(from memory) accQuery = sforce connection ask("select id. (select id from contacts) from account")accIterator = new sforce. QueryResultIterator(accQuery)while(accIterator hasNext()){ be = accIterator next() conIterator = new sforce. QueryResultIterator(be['Contacts']) while(conIterator hasNext() { contact = conIterator next() // do something with contacts here } } © procure 2000-2006 salesforce com inc. Customer Relationship Management (CRM) All rights reserved Various trademarks held by their respective owners.

Forex Groups - Tips on Trading

Related article:
http://community.salesforce.com/sforce/board/message?board.id=ajax_toolkit&message.id=3703#M3703

comments | Add comment | Report as Spam


"Re: strange problem with subquery in select statment" posted by ~Ray
Posted on 2007-11-09 17:36:29

decide ALL (COUNT(STUDENT_ATTENDANCE. ATTENDANCE_MODE))/(SELECTCOUNT(DISTINCT STUDENT_ATTENDANCE. ATTENDANCE_go out)FROM STUDENT_ATTENDANCEWHERE TO_CHAR (STUDENT_ATTENDANCE. ATTENDANCE_DATE. 'MON')='jul') * 100. STUDENT. REGESTRATION_NOFROM STUDENT_ATTENDANCE,STUDENT WHERE STUDENT_ATTENDANCE. ATTENDANCE_MODE = 'present' AND TO_burn (STUDENT_ATTENDANCE. ATTENDANCE_DATE. 'MON' ) ='JUL' AND (STUDENT_ATTENDANCE. REGESTRATION_NO = STUDENT. REGESTRATION_NO)GROUP BY STUDENT. REGESTRATION_NO Instead of playing around with colors you'd rather properly format the label. This is un-re-a-da-ble. Also we don't experience how those tables be desire and what is stored in there; therefore. act TABLE along with INSERT INTO sample data plus expected result set might back up. i m writing this code: decide ALL (ascertain(STUDENT_ATTENDANCE. ATTENDANCE_MODE))/ (SELECT COUNT(DISTINCT STUDENT_ATTENDANCE. ATTENDANCE_DATE) FROM STUDENT_ATTENDANCE WHERE TO_burn (STUDENT_ATTENDANCE. ATTENDANCE_go out. 'MON')='jul') * 100. STUDENT_attendance. REGESTRATION_NO FROM STUDENT_ATTENDANCE WHERE STUDENT_ATTENDANCE. ATTENDANCE_MODE = 'show' AND TO_burn (STUDENT_ATTENDANCE. ATTENDANCE_go out. 'MON' ) ='JUL' AND (STUDENT_ATTENDANCE. REGESTRATION_NO = STUDENT. REGESTRATION_NO) GROUP BY STUDENT. REGESTRATION_NOdescription of delay used(student_attendance) :SQL> exposit student_attendance; Name Null? Type ------------------------------- -------- ---- REGESTRATION_NO VARCHAR2(20) affect_ID be(12) LOGIN_ID VARCHAR2(20) ATTENDANCE_MODE VARCHAR2(20) ATTENDANCE_DATE DATEsample data in delay:REGESTRATION_NO SUBJECT_ID LOGIN_ID ATTENDANCE_MODE ATTENDANC-------------------- ---------- -------------------- -------------------- ---------r11 111 1 present 25-JUL-07r12 111 1 present 25-JUL-07r13 111 1 absent 25-JUL-07r14 111 1 presesnt 25-JUL-07r15 111 1 show 25-JUL-07r40 112 2 present 25-JUL-07 Do you really evaluate us (OK me) to write all that instead of you?When I said "format the code". I really meant you should change code you post (using the [label] tags). When I said act delay. I really meant CREATE TABLE not result of DESC SQL*Plus dominate. When I said attach INTO sample data. I really meant INSERT INTO statements not prove of decide * FROM statement. When I asked for expected prove set. I really meant it. I don't see any. SELECT ALL (ascertain(STUDENT_ATTENDANCE. ATTENDANCE_MODE))/ (SELECT COUNT(DISTINCT STUDENT_ATTENDANCE. ATTENDANCE_go out) FROM STUDENT_ATTENDANCE WHERE TO_burn (STUDENT_ATTENDANCE. ATTENDANCE_DATE. 'MON')='jul') * 100. STUDENT_attendance. REGESTRATION_NO FROM STUDENT_ATTENDANCE WHERE STUDENT_ATTENDANCE. ATTENDANCE_MODE = 'present' AND TO_burn (STUDENT_ATTENDANCE. ATTENDANCE_DATE. 'MON' ) ='JUL' AND (STUDENT_ATTENDANCE. REGESTRATION_NO = STUDENT. REGESTRATION_NO) GROUP BY STUDENT. REGESTRATION_NO create delay Student_attendance(registration_no varchar2(30) ,login_id varchar2(20),subject_id be(*),att_mode varchar2(30),go out date,constraint fk_Student_attendance_login_id foreignkey(login_id) references Login(login_id),constraint fk_Student_attendance_registration_no foreignkey(registration_no) references Student(registration_no),constraint fk_Student_attendance_affect_id foreignkey(subject_id) references Subject(affect_id));attach into student_attendance(regestration_no,subject_id,login_id,attendance_mode,attendance_go out)values (r11,111,1,'present','30-JUL-2007'); Attendance percentage= be number of 'presents'/ be number of lectures * 100Lectures=all be of days of a month in which attendance is enteredthnks SELECT ALL (ascertain(STUDENT_ATTENDANCE. ATTENDANCE_MODE))/(SELECTCOUNT(DISTINCT STUDENT_ATTENDANCE. ATTENDANCE_go out)FROM STUDENT_ATTENDANCEWHERE TO_burn (STUDENT_ATTENDANCE. ATTENDANCE_go out. 'MON' ) ='JUL' ) * 100. STUDENT. REGESTRATION_NOFROM STUDENT_ATTENDANCE,STUDENT WHERE STUDENT_ATTENDANCE. ATTENDANCE_MODE = 'present' AND TO_burn (STUDENT_ATTENDANCE. ATTENDANCE_go out. 'MON' ) ='JUL' AND (STUDENT_ATTENDANCE. REGESTRATION_NO = STUDENT. REGESTRATION_NO)GROUP BY STUDENT. REGESTRATION_N when i run this code(hard code) in parts then it gives change by reversal resulteg first move: SELECT ALL (COUNT(STUDENT_ATTENDANCE. ATTENDANCE_MODE))/6 * 100,STUDENT. REGESTRATION_NOFROM STUDENT_ATTENDANCE,STUDENT WHERE STUDENT_ATTENDANCE. ATTENDANCE_MODE = 'present' AND TO_CHAR (STUDENT_ATTENDANCE. ATTENDANCE_DATE. 'MON' ) ='JUL' AND (STUDENT_ATTENDANCE. REGESTRATION_NO = STUDENT. REGESTRATION_NO)assort BY STUDENT. REGESTRATION_No So am I. Please affix the creation compose for your delay and use a tool to remove 'insert' statements for some (or all) of your data. I will install in one of my test databases and see what I can sight. I can evaluate on Oracle 7. 9 and 10 but I don't undergo access to 8. David decide ALL (ascertain(STUDENT_ATTENDANCE. ATTENDANCE_MODE))/(SELECTCOUNT(DISTINCT STUDENT_ATTENDANCE. ATTENDANCE_DATE)FROM STUDENT_ATTENDANCEWHERE TO_burn (STUDENT_ATTENDANCE. ATTENDANCE_go out. 'MON' ) ='JUL' ) * 100,regestration_noFROM STUDENT_ATTENDANCEWHERE STUDENT_ATTENDANCE. ATTENDANCE_MODE = 'present' AND TO_CHAR (STUDENT_ATTENDANCE. ATTENDANCE_go out. 'MON' ) ='JUL' assort BY REGESTRATION_No; act delay Student_attendance(regestration_no varchar2(30) ,subject_id number(*),login_id varchar2(20),att_mode varchar2(30),date date,constraint fk_Student_attendance_login_id foreign key(login_id) references Login(login_id),constraint fk_Student_attendance_regestration_no foreign key(regestration_no) references Student(registration_no),constraint fk_Student_attendance_affect_id foreign key(subject_id) references Subject(subject_id)); insert into student_attendance values ('r11',111,1,'show','28-JUL-2007');insert into student_attendance values ('r12',111,1,'show','28-JUL-2007');attach into student_attendance values ('r11',111,1,'absent','29-JUL-2007');attach into student_attendance values ('r12',111,1,'absent','29-JUL-2007');insert into student_attendance values ('r11',111,1,'present','30-JUL-2007');attach into student_attendance values ('r12',111,1,'absent','30-JUL-2007'); Yes? Are you reminding me to answer this challenge? I'm still unable to. Obviously you didn't quite understand what I asked you to do (TWICE!) and your script is useless. If you can do something with information provided gratify be my guest. SQL> act table Student_attendance(registration_no varchar2(30) . 2 login_id varchar2(20),subject_id be(*),att_mode varchar2(30). 3 date date. 4 constraint fk_Student_attendance_login_id foreignkey(login_id) references Login(login_id). 5 constraint fk_Student_attendance_registration_no foreignkey(registration_no) references Student(registration_no). 6 constraint fk_Student_attendance_affect_id foreignkey(affect_id) references Subject(affect_id));go out go out,*ERROR at line 3:ORA-00904: : invalid identifierSQL> attach into student_attendance(regestration_no,affect_id,login_id,attendance_mode,attendance_date) 2 values (r11,111,1,'show','30-JUL-2007');insert into student_attendance(regestration_no,subject_id,login_id,attendance_mode,attendance_go out) *ERROR at line 1:ORA-00942: table or believe does not existSQL> SELECT ALL (ascertain(STUDENT_ATTENDANCE. ATTENDANCE_MODE))/(SELECTCOUNT(DISTINCT STUDENT_ATTENDANCE. ATTENDANCE_DATE)FROM STUDENT_ATTENDANCEWHERE TO_burn (STUDENT_ATTENDANCE. ATTENDANCE_DATE. 'MON' ) ='JUL' ) * 100,regestration_noFROM STUDENT_ATTENDANCEWHERE STUDENT_ATTENDANCE. ATTENDANCE_MODE = 'present' AND TO_burn (STUDENT_ATTENDANCE. ATTENDANCE_go out. 'MON' ) ='JUL'.

Forex Groups - Tips on Trading

Related article:
http://www.orafaq.com/forum/index.php?t=rview&goto=265997&th=88756#msg_265997

comments | Add comment | Report as Spam


"When a query with IN subquery may not return the expected rows" posted by ~Ray
Posted on 2007-11-03 14:11:00

accept to this change intensity spot of Oracle's world. If you landed here it must be because you came across some weird or improbable ORA-XXXXX error. I am no guru at least not yet. I am trying to do an honest work annotating some situations that may take hours to be fixed when you are clueless and believe me if you do serious Oracle Development you will be clueless sooner or later. Enjoy your visit!Flavio Casetta One of the most back up misunderstandings with the IN clause is caused by the presence of NULL values on both sides of the comparison. Let's build a simple test case: create table test1 (a number d varchar2(30))/create table test2 (b be)/attach into test1 values(null. 'a is null ')/attach into test1 values(1. 'a = 1')/insert into test2 values(null)/attach into evaluate2 values(1)/act/select * from test1where a in (decide b from test2); A D- -----1 a = 1 If for some reason you're assuming that null=null should return adjust well you're taking a wrong assumption for two simple reasons: NULL = NULL always returns FALSE. NULL must be dealt with using the IS operator not the equal (=) write. If you imagine that the IN clause could be regarded as a series of equality comparisons you can easily alter out why it can disappoint if values on either align of the comparison are NULLs. In case for some reason you be to force a = b to return TRUE change surface in inspect of NULLs then you can try this sub-optimal technique: select * from test1where nvl(a,-1) in (select nvl(b,-1) from evaluate2);A D- ---------a is null1 a = 1 applying NVL to column a however causes the optimizer to rule out any index on delay evaluate1 which will probably result in a full table scan and the consequent poor performance of the query if table test1 is big. These types of problems can be further complicated when you use n-tuples of values. create delay test3 (a be b number d varchar2(30))/act table test4 (c be d number)/attach into evaluate3 values(null null. 'a and b are null ')/insert into test3 values(1 null. 'a = 1 and b is null')/attach into test3 values(1. 1. 'a = 1 and b = 1')/insert into evaluate4 values(null null)/insert into test4 values(1 null)/insert into test4 values(1. 1)/act/select * from test3where (a,b) in (select c,d from test4); A B D- - ---------------1 1 a = 1 and b = 1 Conclusion:having NULLs in the columns you acquire may bring about to unexpected results when using the IN clause so you be to know very well the data you are working on. You may think that this sort of tongue-in-cheek advice however when you're called on to explain why a query doesn't work as expected on a table populated by someone else in a foreign application and without much possibility of inspecting the data yourself you need to be prepared for the beat. If you can't find the posting being referred in the web examine results it's very likely that it has been already archived. analyse out the communicate collect below or the index and you will certainly find the related bind. I began programming computers at the age of 15 and 27 years later i comfort have to forbid!Although i started with a TI-57 my all measure favorite calculators were the HP-71B and the HP-48GX. I am a proud owner of an old my first PC where i taught myself HP BASIC and i still remember that wonderful UNIX (HP-UX) portable computer called with an amazing ELD check and a "thinkjet" printer on top sold in the mid 80's. More than two decades after the introduction of the IBM PC i am about to act the big leap and become a proud owner of an Apple Mac Pro. My other favorite activity besides Oracle programming is cooking and anticipate what cooking is similar to programming but it tastes so much exceed! Did Oraclequirks provide you with useful information?

Forex Groups - Tips on Trading

Related article:
http://oraclequirks.blogspot.com/2007/08/when-query-with-in-subquery-may-not.html

comments | Add comment | Report as Spam


"Dev Articles Forums - Help with subquery: comma-delimited id list ..." posted by ~Ray
Posted on 2007-10-28 12:13:36

Discuss Help with subquery: comma-delimited id enumerate to value in the Microsoft SQL Server forum on Dev Articles. back up with subquery: comma-delimited id list to determine Microsoft SQL Server forum discussing this extremely popular DBMS for the Windows operating system. Learn to hone your SQL Server database for optimum application performance. Gaining Faster Wireless Connections with WiMAXWelcome to what is quickly becoming the hyperconnected world where anything that would benefit from being connected to the network ordain be connected. Hello any MS SQL experts out there! please help if you can i'm trying to run a subquery within a query to keep myself from having to circle over the original ask on display and then run additional queries to get the advance info here's the setup i undergo two tables:persons tablecolumn: name (varchar)column: vehicleids (varchar)vehicles tablecolumn: id (int pk)column: vehiclename (varchar)- The persons delay is a list of peoples' names and what kind of vehicle/s they own.- The persons vehicleids handle is a comma-delimited list of one or more integers which be to the vehicles id field.- The vehicles delay contains a list of vehicles like car ride motorcycle etc distinguished by the vehicles id handle. The result i want returned by the ask is:NAME - VEHICLESJoe Somebody - car,bicycleSheila Johnson - van,pogostick,motorcycleJohn Nobody - skateboard,carThe query i'm trying to run to get this result is: It returns the persons names in the first column but only returns vehicle names in the second column when there's a single id in the persons vehicleids field if there's more than one integer in the field it returns an empty arrange. Can anyone express me what I'm doing wrong? I do have the option of table restructuring if its necessary but I'm not looking for a stored procedure solution or a temp table solution. Any takers? I would be in the kharmic debt of anyone providing a workable avenue. Thank you,Tyler IBM® Workplace™ for SAP® Software leverages existing SAP investments to help improve people productivity by integrating SAP content with IBM leading collaboration and performance management technology. SAP and IBM capabilities are combined into role-based high performance work environments. IBM® Lotus® Expeditor software is IBM's universal managed client software to increase composite applications to laptops desktops kiosks and mobile devices. It can be used to increase your IBM Lotus. IBM WebSphere or Eclipse™ infrastructures to a managed client environment. WebSphere® Host Access Transformation Services (HATS) transforms terminal applications quickly and easily. With HATS you can create Web and rich client applications that provide an easy-to-use graphical user interface (GUI) for your character-based 3270 and 5250 entertain applications. IBM Lotus® Forms convey 3.0 helps mid-market organizations quickly and easily act intelligent Web-based forms without Web programming skills which helps deepen business transactions and reduce operational costs. Business function Management (BSM) has emerged as an approach to help IT mouth clear business value amidst increasing complexity and constant pressure to reduce costs. BSM and network management software solutions built with proprietary code have proven to adapt poorly to the changing IT landscape despite their steep prices. While label centers are essential to thousands of businesses many experience from high operational costs. Increasingly organizations are discovering how to improve results by allowing capacity to be added on-demand. In this white paper see how elasticity ordain make your label center a more valuable resource and positively affect your bottom lie. Novell makes it easy to merge your Windows applications and other legacy services with the innovative SUSE® Linux Enterprise Virtual forge Driver case and its underlying Linux server. You’ll bring home the bacon near-native performance of your virtual systems increase the life of your software investments and reduce infrastructure costs. OpenGate allows for communicate centers without existing technologies to apply an industry-leading platform for their telephony & CTI requirements. OpenGate may be used as a dedicated standalone solution within an enterprise contact bear on and serves as a gateway between the contact bear on and the PSTN via T1/E1 interfaces or SIP trunks for VoIP. Coupa e-Procurement Software delivers big business purchasing automation and spending controls to small and mid-size organizations. As a Web 2.0 solution that employees actually like to use rather than to avoid. Coupa procurement software enables companies to contour procurement processes alter productivity and save money. The agile versus waterfall development debate is about delivering top quality products that understand high impact problems. Technology companies want to interpret market share and generate healthy revenue streams. This bind discusses concepts of both methodologies.

Forex Groups - Tips on Trading

Related article:
http://forums.devarticles.com/microsoft-sql-server-5/help-with-subquery-comma-delimited-id-list-to-value-111904.html

comments | Add comment | Report as Spam


"[ZF-1856] Using subquery in from() is broken because of new schema ..." posted by ~Ray
Posted on 2007-10-23 16:06:08

Using a subquery as the table argument in the from() label used to work fine desire so: $select = $db->select();$select->from("(decide people id from people)". "count(id)"); I experience there are cleaner ways to get the same result but this is a simplified version and in some cases it is necessary to do a select like this for example when doing your own pagination you may be to put the sql from one query into a call like this to sight out the be of rows returned from it. When doing this if the code in the delay argument contains a period the new schema code on line 358 in Select php ordain break the query: // Schema from delay name overrides schema argument if (false !== strpos($tableName. '.')) { list($schema. $tableName) = explode('.'. $tableName); } Using a subquery as the table argument in the from() call used to bring home the bacon fine desire so:$select = $db->decide();$select->from("(decide people id from populate)". "ascertain(id)");I know there are cleaner ways to get the same prove but this is a simplified version and in some cases it is necessary to do a decide like this for example when doing your own pagination you may want to put the sql from one query into a call desire this to find out the number of rows returned from it. When doing this if the label in the delay argument contains a period the new schema label on lie 358 in decide php ordain end the query: // Schema from delay label overrides schema argument if (false !== strpos($tableName. '.')) { list($schema. $tableName) = explode('.'. $tableName); }

Forex Groups - Tips on Trading

Related article:
http://framework.zend.com/issues/browse/ZF-1856

comments | Add comment | Report as Spam


"Re: subquery problem" posted by ~Ray
Posted on 2007-10-17 14:40:41

********************************************** i undergo two tables book and issue book contains book_name,schedule_id and issue contains issue_date,book_id. i want to display the schedule_name,issue_date for that bookone way is equijoin or natural connect desire thisselect book_label,issue_date from schedule natural join issueorselect book_label,issue_date from book b air i where b book_id=i book_idbut when i try to get through subquery its giving wrong resultsI used following subqueryselect schedule_label,air_date from book b issue i where b book_id in( select book_id from issue)gratify express how can i use simple subquery hereplz replythanksashish Please read and follow especially "How to format your affix?" section. Make sure that lines of label do not exceed 80 characters when you format. Use the "catch communicate" button. Please always post your Oracle version (4 decimals). RegardsMichel It's a good idea to be specific on which table the columns are coming from. You shouldn't need to use a sub query here unless it's a homework problem. In that inspect you're on your own because I wouldn't use a sub query for such a simple statement. Ron It's a good idea to be specific on which table the columns are coming from. You shouldn't need to use a sub ask here unless it's a homework problem. In that inspect you're on your own because I wouldn't use a sub query for such a simple statement. Ron thanks ron i had already tried join was just trying to alter my concept of retriving values from multiple tables using sub query but its giving cross jointhanks Your column_names are 'wrong'. If you undergo a table called BOOKS what do you think a column ID in that delay would be? change by reversal. A book-id. The delay_name should (normally) not be included in any column label in that table. >No way. Subquery at where clause always go single column determine but you want more than one cloun from subquery. [sic] is guess "cloun" is supposed to be 'column'HUH? 12:57:47 SQL> @two-columns sql12:57:56 SQL> displace table evaluate1;Table dropped.12:57:58 SQL> drop table evaluate2;Table dropped.12:57:59 SQL> create delay evaluate1(id1 number id2 number id3 be);delay created.12:57:59 SQL> create delay test2(id1 be id2 be id3 number);delay created.12:57:59 SQL> insert into evaluate1 values(1,2,3);1 row created.12:57:59 SQL> insert into evaluate1 values(2,3,4);1 row created.12:57:59 SQL> insert into evaluate1 values(1,2,4);1 row created.12:57:59 SQL> insert into test2 values(1,2,5);1 row created.12:57:59 SQL> select * from test1 where (id1 id2) in (decide id1 id2 from test2); ID1 ID2 ID3---------- ---------- ---------- 1 2 4 1 2 312:57:59 SQL> Never use ALWAYS! (Never use never too). Above subquery seems to go more than 1 column. >No way. Subquery at where clause always return hit column value but you want more than one cloun from subquery. [sic] is guess "cloun" is supposed to be 'column'HUH? 12:57:47 SQL> @two-columns sql12:57:56 SQL> drop delay test1;Table dropped.12:57:58 SQL> displace delay test2;delay dropped.12:57:59 SQL> create delay evaluate1(id1 be id2 number id3 number);Table created.12:57:59 SQL> create table evaluate2(id1 number id2 number id3 be);Table created.12:57:59 SQL> insert into evaluate1 values(1,2,3);1 row created.12:57:59 SQL> insert into evaluate1 values(2,3,4);1 row created.12:57:59 SQL> insert into evaluate1 values(1,2,4);1 row created.12:57:59 SQL> insert into test2 values(1,2,5);1 row created.12:57:59 SQL> decide * from test1 where (id1 id2) in (decide id1 id2 from test2); ID1 ID2 ID3---------- ---------- ---------- 1 2 4 1 2 312:57:59 SQL> Never use ALWAYS! (Never use never too). Above subquery seems to return more than 1 column.

Forex Groups - Tips on Trading

Related article:
http://www.orafaq.com/forum/index.php?t=rview&goto=265650&th=88849#msg_265650

comments | Add comment | Report as Spam


"Re: subquery problem" posted by ~Ray
Posted on 2007-10-10 16:28:40

********************************************** i have two tables book and issue book contains schedule_label,book_id and issue contains issue_go out,book_id. i be to display the book_label,air_go out for that bookone way is equijoin or natural connect desire thisselect schedule_name,air_go out from book natural join issueorselect book_label,air_go out from book b air i where b book_id=i book_idbut when i try to get through subquery its giving wrong resultsI used following subqueryselect book_label,issue_go out from book b air i where b book_id in( decide book_id from air)please tell how can i use simple subquery hereplz replythanksashish Please read and follow especially "How to format your post?" section. Make sure that lines of label do not exceed 80 characters when you change. Use the "catch Message" button. gratify always affix your Oracle version (4 decimals). RegardsMichel It's a good idea to be specific on which delay the columns are coming from. You shouldn't be to use a sub query here unless it's a homework problem. In that inspect you're on your own because I wouldn't use a sub query for such a simple statement. Ron It's a good idea to be specific on which table the columns are coming from. You shouldn't need to use a sub ask here unless it's a homework problem. In that case you're on your own because I wouldn't use a sub ask for such a simple statement. Ron thanks ron i had already tried join was just trying to clear my concept of retriving values from multiple tables using sub query but its giving cross jointhanks Your column_names are 'wrong'. If you have a table called BOOKS what do you think a column ID in that delay would be? change by reversal. A book-id. The table_label should (normally) not be included in any column name in that table. >No way. Subquery at where clause always return single column value but you be more than one cloun from subquery. [sic] is guess "cloun" is supposed to be 'column'HUH? 12:57:47 SQL> @two-columns sql12:57:56 SQL> drop delay evaluate1;Table dropped.12:57:58 SQL> drop table test2;Table dropped.12:57:59 SQL> create delay test1(id1 number id2 number id3 number);delay created.12:57:59 SQL> create table evaluate2(id1 be id2 number id3 number);delay created.12:57:59 SQL> insert into evaluate1 values(1,2,3);1 row created.12:57:59 SQL> insert into test1 values(2,3,4);1 row created.12:57:59 SQL> insert into evaluate1 values(1,2,4);1 row created.12:57:59 SQL> insert into test2 values(1,2,5);1 row created.12:57:59 SQL> select * from test1 where (id1 id2) in (select id1 id2 from test2); ID1 ID2 ID3---------- ---------- ---------- 1 2 4 1 2 312:57:59 SQL> Never use ALWAYS! (Never use never too). Above subquery seems to return more than 1 column. >No way. Subquery at where clause always return single column value but you want more than one cloun from subquery. [sic] is suspect "cloun" is supposed to be 'column'HUH? 12:57:47 SQL> @two-columns sql12:57:56 SQL> drop table test1;Table dropped.12:57:58 SQL> drop table test2;delay dropped.12:57:59 SQL> create table evaluate1(id1 number id2 be id3 be);Table created.12:57:59 SQL> create table evaluate2(id1 be id2 be id3 be);Table created.12:57:59 SQL> insert into test1 values(1,2,3);1 row created.12:57:59 SQL> insert into evaluate1 values(2,3,4);1 row created.12:57:59 SQL> insert into evaluate1 values(1,2,4);1 row created.12:57:59 SQL> attach into evaluate2 values(1,2,5);1 row created.12:57:59 SQL> select * from evaluate1 where (id1 id2) in (decide id1 id2 from evaluate2); ID1 ID2 ID3---------- ---------- ---------- 1 2 4 1 2 312:57:59 SQL> Never use ALWAYS! (Never use never too). Above subquery seems to go more than 1 column.

Forex Groups - Tips on Trading

Related article:
http://www.orafaq.com/forum/index.php?t=rview&goto=265579&th=88849#msg_265579

comments | Add comment | Report as Spam


"subquery problem" posted by ~Ray
Posted on 2007-10-02 21:11:16

********************************************** i undergo two tables schedule and issue schedule contains book_name,schedule_id and air contains issue_date,book_id. i want to display the schedule_name,issue_date for that bookone way is equijoin or natural connect desire thisselect schedule_label,issue_date from book natural join issueorselect schedule_name,issue_go out from schedule b issue i where b schedule_id=i book_idbut when i try to get through subquery its giving do by resultsI used following subqueryselect schedule_name,air_go out from book b issue i where b schedule_id in( select schedule_id from issue)gratify express how can i use simple subquery hereplz replythanksashish gratify read and go especially "How to format your post?" divide. Make sure that lines of label do not exceed 80 characters when you change. Use the "catch communicate" button. gratify always affix your Oracle version (4 decimals). RegardsMichel It's a good idea to be specific on which table the columns are coming from. You shouldn't need to use a sub query here unless it's a homework problem. In that inspect you're on your own because I wouldn't use a sub query for such a simple statement. Ron It's a good idea to be specific on which table the columns are coming from. You shouldn't be to use a sub query here unless it's a homework problem. In that inspect you're on your own because I wouldn't use a sub query for such a simple statement. Ron thanks ron i had already tried join was just trying to clear my concept of retriving values from multiple tables using sub query but its giving cross jointhanks Your column_names are 'do by'. If you undergo a table called BOOKS what do you evaluate a column ID in that delay would represent? Correct. A book-id. The table_label should (normally) not be included in any column name in that table. >No way. Subquery at where clause always go single column determine but you want more than one cloun from subquery. [sic] is guess "cloun" is supposed to be 'column'HUH? 12:57:47 SQL> @two-columns sql12:57:56 SQL> drop table evaluate1;delay dropped.12:57:58 SQL> drop table test2;delay dropped.12:57:59 SQL> act delay test1(id1 be id2 number id3 number);Table created.12:57:59 SQL> create delay evaluate2(id1 number id2 be id3 number);delay created.12:57:59 SQL> attach into test1 values(1,2,3);1 row created.12:57:59 SQL> insert into test1 values(2,3,4);1 row created.12:57:59 SQL> attach into evaluate1 values(1,2,4);1 row created.12:57:59 SQL> insert into test2 values(1,2,5);1 row created.12:57:59 SQL> decide * from evaluate1 where (id1 id2) in (decide id1 id2 from test2); ID1 ID2 ID3---------- ---------- ---------- 1 2 4 1 2 312:57:59 SQL> Never use ALWAYS! (Never use never too). Above subquery seems to return more than 1 column. >No way. Subquery at where clause always return hit column value but you want more than one cloun from subquery. [sic] is guess "cloun" is supposed to be 'column'HUH? 12:57:47 SQL> @two-columns sql12:57:56 SQL> drop table evaluate1;delay dropped.12:57:58 SQL> drop delay test2;delay dropped.12:57:59 SQL> act delay evaluate1(id1 number id2 be id3 be);delay created.12:57:59 SQL> act delay test2(id1 number id2 number id3 number);Table created.12:57:59 SQL> attach into evaluate1 values(1,2,3);1 row created.12:57:59 SQL> attach into evaluate1 values(2,3,4);1 row created.12:57:59 SQL> insert into evaluate1 values(1,2,4);1 row created.12:57:59 SQL> attach into test2 values(1,2,5);1 row created.12:57:59 SQL> select * from evaluate1 where (id1 id2) in (select id1 id2 from evaluate2); ID1 ID2 ID3---------- ---------- ---------- 1 2 4 1 2 312:57:59 SQL> Never use ALWAYS! (Never use never too). Above subquery seems to return more than 1 column.

Forex Groups - Tips on Trading

Related article:
http://www.orafaq.com/forum/index.php?t=rview&goto=265562&th=88849#msg_265562

comments | Add comment | Report as Spam


 

 




blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




the subquery archives:

11 articles in 2006-01
22 articles in 2006-02
27 articles in 2006-03
37 articles in 2006-04
27 articles in 2006-05
26 articles in 2006-06
24 articles in 2006-07
18 articles in 2006-08
22 articles in 2006-09
30 articles in 2006-10
22 articles in 2006-11
22 articles in 2006-12
12 articles in 2007-01
12 articles in 2007-02
3 articles in 2007-03
7 articles in 2007-04
11 articles in 2007-05
10 articles in 2007-06
3 articles in 2007-07
1 articles in 2007-09




next page


subquery