Click here to Skip to main content
15,885,278 members
Home / Discussions / Database
   

Database

 
AnswerRe: Please help with an UPDATE statement conflicted with the FOREIGN KEY constraint problem Pin
Shameel5-Feb-12 19:42
professionalShameel5-Feb-12 19:42 
QuestionSSMS question Pin
SQL Ed4-Feb-12 6:24
SQL Ed4-Feb-12 6:24 
AnswerRe: SSMS question Pin
Eddy Vluggen4-Feb-12 22:52
professionalEddy Vluggen4-Feb-12 22:52 
QuestionNeed help for Customize the except query Pin
ptr_Electron3-Feb-12 1:30
ptr_Electron3-Feb-12 1:30 
AnswerRe: Need help for Customize the except query Pin
jschell3-Feb-12 11:02
jschell3-Feb-12 11:02 
AnswerRe: Need help for Customize the except query Pin
Mycroft Holmes3-Feb-12 12:00
professionalMycroft Holmes3-Feb-12 12:00 
GeneralRe: Need help for Customize the except query Pin
ptr_Electron3-Feb-12 22:53
ptr_Electron3-Feb-12 22:53 
QuestionOracle - odd behavior with nested select/join Pin
Paladin20002-Feb-12 9:19
Paladin20002-Feb-12 9:19 
Here is a strange result that I am getting with Oracle. Unless I wrap the select from TABLE1 as shown (specifying "rownum > 0"), the query never seems to complete. However, when it is included, it only takes a second or two.

It doesn't make any sense to me, because all that it seems to do is force Oracle to evaluate the nested select with the alias "a" before performing the join. I had thought that placing it in parenthesis would do that automatically. Perhaps the Oracle optimizer does something wonky that this compensates for..? Scratching my head here, because all that the "where" condition adds is basically saying "give me any rows that you find".

SQL
select COUNTRY_NAME, count(*) TALLY from
  (
    select * from (
    select IP_SOURCE_NUM from TABLE1 
    where log_date between '01-JAN-2012' and date '01-FEB-2012'
      and IP_SOURCE_NUM > 0
    ) where rownum > 0 
  ) a
  JOIN ip_geo b on b.ip_from = 
  (
    select max(ip_from) as ip_from_match from ip_geo
    where ip_from <= a.IP_SOURCE_NUM
  )
group by COUNTRY_NAME
order by count(*) desc

AnswerRe: Oracle - odd behavior with nested select/join Pin
Mycroft Holmes2-Feb-12 13:16
professionalMycroft Holmes2-Feb-12 13:16 
GeneralRe: Oracle - odd behavior with nested select/join Pin
Jörgen Andersson2-Feb-12 21:32
professionalJörgen Andersson2-Feb-12 21:32 
AnswerRe: Oracle - odd behavior with nested select/join Pin
Jörgen Andersson2-Feb-12 21:31
professionalJörgen Andersson2-Feb-12 21:31 
GeneralRe: Oracle - odd behavior with nested select/join Pin
Paladin20003-Feb-12 4:14
Paladin20003-Feb-12 4:14 
QuestionInsert Statment Pin
Seema Bawa2-Feb-12 9:05
Seema Bawa2-Feb-12 9:05 
AnswerRe: Insert Statment PinPopular
jschell2-Feb-12 9:13
jschell2-Feb-12 9:13 
QuestionRe: Insert Statment Pin
Chris Meech2-Feb-12 15:30
Chris Meech2-Feb-12 15:30 
AnswerRe: Insert Statment Pin
Corporal Agarn3-Feb-12 1:24
professionalCorporal Agarn3-Feb-12 1:24 
AnswerRe: Insert Statment Pin
Dnyanesh Wahiley8-Feb-12 1:25
Dnyanesh Wahiley8-Feb-12 1:25 
QuestionFind un identical rows from two Tbls based on combination of 3 columns Pin
ptr_Electron2-Feb-12 2:38
ptr_Electron2-Feb-12 2:38 
AnswerRe: Find un identical rows from two Tbls based on combination of 3 columns Pin
Jörgen Andersson2-Feb-12 4:03
professionalJörgen Andersson2-Feb-12 4:03 
AnswerRe: Find un identical rows from two Tbls based on combination of 3 columns Pin
Blue_Boy2-Feb-12 5:05
Blue_Boy2-Feb-12 5:05 
Questionfinding full path of subgroup with t-sql? Pin
maliheSadat1-Feb-12 21:03
maliheSadat1-Feb-12 21:03 
AnswerRe: finding full path of subgroup with t-sql? Pin
Mycroft Holmes2-Feb-12 0:57
professionalMycroft Holmes2-Feb-12 0:57 
QuestionQuery the records that are not same in two different table. Pin
ptr_Electron1-Feb-12 3:21
ptr_Electron1-Feb-12 3:21 
AnswerRe: Query the records that are not same in two different table. Pin
Simon_Whale1-Feb-12 3:30
Simon_Whale1-Feb-12 3:30 
GeneralRe: Query the records that are not same in two different table. Pin
ptr_Electron1-Feb-12 3:46
ptr_Electron1-Feb-12 3:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.