Click here to Skip to main content
15,922,630 members
Home / Discussions / Database
   

Database

 
GeneralView Pin
.NET- India 7-Apr-08 3:36
.NET- India 7-Apr-08 3:36 
GeneralRe: View Pin
John_Adams7-Apr-08 4:26
John_Adams7-Apr-08 4:26 
QuestionHow to add not null column in SQL Server 2005? Pin
salon6-Apr-08 22:35
salon6-Apr-08 22:35 
AnswerRe: How to add not null column in SQL Server 2005? Pin
Ashfield7-Apr-08 1:46
Ashfield7-Apr-08 1:46 
AnswerRe: How to add not null column in SQL Server 2005? Pin
Mark J. Miller7-Apr-08 5:29
Mark J. Miller7-Apr-08 5:29 
Generallink database to adialog based application Pin
lahom6-Apr-08 12:33
lahom6-Apr-08 12:33 
Generalwhere add related tables automatically on diagram sql server 2005 Pin
Rami Said Abd Alhalim5-Apr-08 23:42
Rami Said Abd Alhalim5-Apr-08 23:42 
GeneralRe: where add related tables automatically on diagram sql server 2005 Pin
Blue_Boy6-Apr-08 20:17
Blue_Boy6-Apr-08 20:17 
GeneralSql qstn(bit) Pin
hari4ur5-Apr-08 0:22
hari4ur5-Apr-08 0:22 
GeneralRe: Sql qstn(bit) Pin
Colin Angus Mackay5-Apr-08 5:04
Colin Angus Mackay5-Apr-08 5:04 
GeneralRe: Sql qstn(bit) Pin
Mycroft Holmes5-Apr-08 18:16
professionalMycroft Holmes5-Apr-08 18:16 
GeneralMSSQL 2000 trigger on update [modified] Pin
Ronni Marker4-Apr-08 23:12
Ronni Marker4-Apr-08 23:12 
GeneralRe: MSSQL 2000 trigger on update Pin
Ronni Marker5-Apr-08 1:24
Ronni Marker5-Apr-08 1:24 
GeneralI have an Interesting Problem Pin
keencomputer4-Apr-08 20:43
keencomputer4-Apr-08 20:43 
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 

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.