Click here to Skip to main content
15,896,269 members
Home / Discussions / Database
   

Database

 
GeneralRe: I have an Interesting Problem Pin
Rami Said Abd Alhalim5-Apr-08 23:44
Rami Said Abd Alhalim5-Apr-08 23:44 
GeneralConcurrency violation on update command. Pin
msx234-Apr-08 14:11
msx234-Apr-08 14:11 
GeneralRe: Concurrency violation on update command. Pin
Rami Said Abd Alhalim5-Apr-08 23:49
Rami Said Abd Alhalim5-Apr-08 23:49 
QuestionStored-Procedure (SP) - Executed as single transaction? Pin
Adeel Chaudhry4-Apr-08 9:26
Adeel Chaudhry4-Apr-08 9:26 
AnswerRe: Stored-Procedure (SP) - Executed as single transaction? Pin
Mark J. Miller4-Apr-08 12:03
Mark J. Miller4-Apr-08 12:03 
GeneralRe: Stored-Procedure (SP) - Executed as single transaction? Pin
Adeel Chaudhry5-Apr-08 4:50
Adeel Chaudhry5-Apr-08 4:50 
GeneralRe: Stored-Procedure (SP) - Executed as single transaction? Pin
Mark J. Miller6-Apr-08 4:31
Mark J. Miller6-Apr-08 4:31 
QuestionHelp in understanding a simple query result Pin
Snowman584-Apr-08 8:17
Snowman584-Apr-08 8:17 
I am an SQL newbee & not understanding the results I am getting from a seemingly simple query. The query itself is returning the correct result but taking far too long. So I ran Explain to see what was happening. Sure enough more data is being examined than expected. But I can't figure out why. I have tried reordering the joins, but get the same result. Perhaps someone could educate me why it is returning so much data.

Note: All ID's are integer types. The ID of the respective tables are the primary key and the ID's used in the Assemdata table are indexed. MySQL ver 5.x

select
assemdata.AssemNum
innerpack.Descrip
hanger.Descrip
from
hanger join innerpack join assemdata
where
assemdata.Assemnum >=60000 and assemdata.Assemnum <=60050
and assemdata.InnerPackTypeID = innerpack.InnerPackID
and assemdata.hangerID = hanger.HangerID

Explain Result:
ID select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE innerpack ALL PRIMARY (Null) (Null) (Null) 3 Using where
1 SIMPLE assemdata ALL (Null) (Null) (Null) (Null) 2798 Using where
1 SIMPLE hanger ALL PRIMARY (Null) (Null) (Null) 2 Using where

Query Result:
AssemNum Descrip Descrip
60001 None Sawtooth
60002 None Sawtooth
60003 None Sawtooth
...... 49 Rows of data.

Thanks for any suggestions!
GeneralRe: Help in understanding a simple query result Pin
A Wong4-Apr-08 9:02
A Wong4-Apr-08 9:02 
GeneralRe: Help in understanding a simple query result Pin
Snowman584-Apr-08 9:10
Snowman584-Apr-08 9:10 
GeneralRe: Help in understanding a simple query result Pin
A Wong4-Apr-08 9:54
A Wong4-Apr-08 9:54 
GeneralRe: Help in understanding a simple query result Pin
Snowman584-Apr-08 10:00
Snowman584-Apr-08 10:00 
GeneralRe: Help in understanding a simple query result Pin
suppaman5-Apr-08 4:24
suppaman5-Apr-08 4:24 
GeneralRe: Help in understanding a simple query result Pin
Snowman586-Apr-08 16:17
Snowman586-Apr-08 16:17 
GeneralRe: Help in understanding a simple query result Pin
suppaman10-Apr-08 13:11
suppaman10-Apr-08 13:11 
QuestionSQL 2000 Problem Pin
hrrty4-Apr-08 1:48
hrrty4-Apr-08 1:48 
GeneralRe: SQL 2000 Problem Pin
GuyThiebaut4-Apr-08 11:30
professionalGuyThiebaut4-Apr-08 11:30 
GeneralHown to select the telephone number that is most dialled Pin
Daniel_Logan3-Apr-08 23:52
Daniel_Logan3-Apr-08 23:52 
GeneralRe: Hown to select the telephone number that is most dialled Pin
Colin Angus Mackay4-Apr-08 0:25
Colin Angus Mackay4-Apr-08 0:25 
GeneralDifference between Correlated and Simple Subqueries Pin
.NET- India 3-Apr-08 23:50
.NET- India 3-Apr-08 23:50 
GeneralRe: Difference between Correlated and Simple Subqueries Pin
pmarfleet4-Apr-08 0:03
pmarfleet4-Apr-08 0:03 
GeneralRe: Difference between Correlated and Simple Subqueries Pin
.NET- India 4-Apr-08 0:15
.NET- India 4-Apr-08 0:15 
GeneralRe: Difference between Correlated and Simple Subqueries Pin
Krazy Programmer4-Apr-08 0:22
Krazy Programmer4-Apr-08 0:22 
GeneralRe: Difference between Correlated and Simple Subqueries Pin
pmarfleet4-Apr-08 0:35
pmarfleet4-Apr-08 0:35 
QuestionIncorrect syntax near stored procedure Pin
Krazy Programmer3-Apr-08 23:36
Krazy Programmer3-Apr-08 23:36 

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.