Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » LIST2 Pattern Problem
Re: LINK2 Pattern Problem [message #2133 is a reply to message #2120] Thu, 18 June 2009 10:36 Go to previous messageGo to previous message
ajwid01 is currently offline  ajwid01
Messages: 26
Registered: June 2009
Location: UK
Junior Member
Another couple of excerpts that confused me here too:

This bit of SQL is obviously checking we just get 1 row returned for the assumed primary key

SELECT count(*) FROM olap_delivery_data3 WHERE olap_delivery_data3.seq_number='138376'  =>Count=1


This SQL appears to be going and retrieving all the fields for the parent record, utilising the primary key sequence number:

select * from ( select a.*, rownum as rnum from ( SELECT olap_delivery_data3.* FROM olap_delivery_data3 WHERE olap_delivery_data3.seq_number='138376'    ) a where rownum <= 1 ) where rnum >= 1=>Count=1


This is where is gets confusing:

I don't understand why this piece of SQL goes and runs, effectively returning a count of the total number of child records that match ALL records in the parent table.

Shouldn't it just be delimiting here with an additional where clause on the SEQ_NUMBER?

SELECT count(*) FROM olap_delivery_notes3 LEFT JOIN olap_delivery_data3 ON (olap_delivery_data3.seq_number=olap_delivery_notes3.delivery_data_seq)   =>Count=2076


These are the preceding steps to the earlier post, but it's obviously following a similar vane, in that it doesn't seem to want to pass through a where clause to the child selection query.

Surprised
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Question about the session page stack
Next Topic: AUTO_INCREMENT PK Column for Oracle Table
Goto Forum:
  


Current Time: Thu Jul 18 01:38:19 EDT 2024

Total time taken to generate the page: 0.02814 seconds