Click here to Skip to main content
15,890,690 members
Home / Discussions / Database
   

Database

 
AnswerRe: MySQL-incorrect information in file frm Pin
Luc Pattyn10-Nov-10 7:21
sitebuilderLuc Pattyn10-Nov-10 7:21 
GeneralRe: MySQL-incorrect information in file frm Pin
PeriyasamyRamachandran10-Nov-10 17:12
PeriyasamyRamachandran10-Nov-10 17:12 
QuestionSQL where Clause help needed Pin
Member 44205349-Nov-10 23:11
Member 44205349-Nov-10 23:11 
AnswerRe: SQL where Clause help needed Pin
Blue_Boy9-Nov-10 23:31
Blue_Boy9-Nov-10 23:31 
AnswerRe: SQL where Clause help needed Pin
Scubapro10-Nov-10 1:07
Scubapro10-Nov-10 1:07 
AnswerRe: SQL where Clause help needed Pin
Chris Meech10-Nov-10 6:51
Chris Meech10-Nov-10 6:51 
QuestionBasic Question from a newbie Pin
JohnnyG9-Nov-10 14:49
JohnnyG9-Nov-10 14:49 
AnswerRe: Basic Question from a newbie PinPopular
Jörgen Andersson9-Nov-10 23:54
professionalJörgen Andersson9-Nov-10 23:54 
Put all categories in the same table and let the subcategories reference their parent categories like this:
CREATE TABLE Categories (
  id              NUMBER(8,0)    NOT NULL,
  parentid        NUMBER(8,0)    NULL,
  name            VARCHAR2(36)   NOT NULL,
  more stuff..
  )
/
ALTER TABLE Categories ADD CONSTRAINT Categories_pk PRIMARY KEY (id)
/
ALTER TABLE Categories ADD CONSTRAINT Categories_id_fk FOREIGN KEY (parentid) REFERENCES Categories (id)

Then select the top categories with: select id,name from categories where parentid is null

And a subcategory with: select id,name from categories where parentid = <ID>

The self referencing foreign key blocks accidental deletion of a category that has subcategories

"When did ignorance become a point of view" - Dilbert

GeneralRe: Basic Question from a newbie Pin
PIEBALDconsult10-Nov-10 2:10
mvePIEBALDconsult10-Nov-10 2:10 
GeneralRe: Basic Question from a newbie Pin
JohnnyG10-Nov-10 2:36
JohnnyG10-Nov-10 2:36 
QuestionGetting InvalidCastException using VS2005 TableAdapter generator to call a stored procedure Pin
Brian C Hart8-Nov-10 18:49
professionalBrian C Hart8-Nov-10 18:49 
AnswerRe: Getting InvalidCastException using VS2005 TableAdapter generator to call a stored procedure Pin
John Gathogo8-Nov-10 19:05
John Gathogo8-Nov-10 19:05 
GeneralRe: Getting InvalidCastException using VS2005 TableAdapter generator to call a stored procedure Pin
Brian C Hart8-Nov-10 20:06
professionalBrian C Hart8-Nov-10 20:06 
QuestionOracle ALL_TAB_COLUMNS Pin
Mycroft Holmes7-Nov-10 13:33
professionalMycroft Holmes7-Nov-10 13:33 
AnswerRe: Oracle ALL_TAB_COLUMNS Pin
Jörgen Andersson7-Nov-10 20:20
professionalJörgen Andersson7-Nov-10 20:20 
GeneralRe: Oracle ALL_TAB_COLUMNS Pin
Mycroft Holmes7-Nov-10 21:13
professionalMycroft Holmes7-Nov-10 21:13 
GeneralRe: Oracle ALL_TAB_COLUMNS [modified] Pin
Jörgen Andersson7-Nov-10 21:43
professionalJörgen Andersson7-Nov-10 21:43 
GeneralRe: Oracle ALL_TAB_COLUMNS Pin
Mycroft Holmes7-Nov-10 22:26
professionalMycroft Holmes7-Nov-10 22:26 
GeneralRe: Oracle ALL_TAB_COLUMNS Pin
Jörgen Andersson7-Nov-10 23:05
professionalJörgen Andersson7-Nov-10 23:05 
Questionhow to insert variable values in SQL server using INSERT INTO statement? Pin
MahaKh4-Nov-10 20:41
MahaKh4-Nov-10 20:41 
AnswerRe: how to insert variable values in SQL server using INSERT INTO statement? Pin
RaviRanjanKr5-Nov-10 6:32
professionalRaviRanjanKr5-Nov-10 6:32 
AnswerRe: how to insert variable values in SQL server using INSERT INTO statement? Pin
PIEBALDconsult6-Nov-10 3:59
mvePIEBALDconsult6-Nov-10 3:59 
GeneralRe: how to insert variable values in SQL server using INSERT INTO statement? Pin
MahaKh6-Nov-10 23:49
MahaKh6-Nov-10 23:49 
GeneralRe: how to insert variable values in SQL server using INSERT INTO statement? Pin
PIEBALDconsult7-Nov-10 3:12
mvePIEBALDconsult7-Nov-10 3:12 
GeneralRe: how to insert variable values in SQL server using INSERT INTO statement? Pin
RaviRanjanKr8-Nov-10 7:12
professionalRaviRanjanKr8-Nov-10 7:12 

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.