Click here to Skip to main content
15,923,226 members
Home / Discussions / Database
   

Database

 
GeneralRe: basic question inserting data into a table Pin
Blue_Boy27-Apr-08 11:53
Blue_Boy27-Apr-08 11:53 
GeneralRe: basic question inserting data into a table Pin
Rob Graham30-Apr-08 3:47
Rob Graham30-Apr-08 3:47 
Questionsql refresh Pin
bapu288927-Apr-08 8:26
bapu288927-Apr-08 8:26 
GeneralRe: sql refresh Pin
Blue_Boy27-Apr-08 10:39
Blue_Boy27-Apr-08 10:39 
QuestionRe: sql refresh Pin
bapu288928-Apr-08 9:45
bapu288928-Apr-08 9:45 
GeneralRe: sql refresh Pin
mrcsn29-Apr-08 1:05
mrcsn29-Apr-08 1:05 
QuestionRe: sql refresh Pin
bapu288929-Apr-08 9:36
bapu288929-Apr-08 9:36 
GeneralQuestion about pivot Pin
Marc Clifton27-Apr-08 8:00
mvaMarc Clifton27-Apr-08 8:00 
Perhaps pivot isn't what I'm looking for, but here's what I'm trying to accomplish (pardon the XML).

I have a table of species:

<TableDef IsPooled="false" Name="Species">
  <Fields>
    <TableFieldDef Length="0" DataType="Integer" IsPK="true" IsIdentity="true" Name="ID" />
    <TableFieldDef Length="0" DataType="Integer" PKTable="Family" PKField="ID" Name="FamilyID" />
    <TableFieldDef Length="50" Name="Name" />
    <TableFieldDef Length="50" Name="CommonName" />
  </Fields>
</TableDef>


and a table of samples:

<TableDef IsPooled="false" Name="Sample">
  <Fields>
    <TableFieldDef Length="0" DataType="Integer" IsPK="true" IsIdentity="true" Name="ID" />
    <TableFieldDef Length="0" DataType="Date" Name="SampleDate" />
    <TableFieldDef Length="0" DataType="Integer" PKTable="SamplingSite" PKField="ID" Name="SamplingSiteID" />
    <TableFieldDef Length="0" DataType="Integer" PKTable="Species" PKField="ID" Name="SpeciesID" />
    <TableFieldDef Length="16" AllowNull="true" Name="AbundanceRank" />
    <TableFieldDef Length="16" AllowNull="true" Name="PercentCover" />
    <TableFieldDef DefaultValue="false" Length="0" DataType="Boolean" Name="Present" />
  </Fields>
</TableDef>


which references the sampling sites table:

<TableDef IsPooled="false" Name="SamplingSite">
  <Fields>
    <TableFieldDef Length="0" DataType="Integer" IsPK="true" IsIdentity="true" Name="ID" />
    <TableFieldDef Length="0" DataType="Integer" PKTable="Location" PKField="ID" Name="LocationID" />
    <TableFieldDef Length="0" DataType="Integer" PKTable="Subhabitat" PKField="ID" Name="SubhabitatID" />
    <TableFieldDef Length="0" DataType="Integer" PKTable="GPSCoord" PKField="ID" Name="GPSID" />
    <TableFieldDef Length="512" Name="Descr" />
  </Fields>
</TableDef>


What I'd like is a vertical list of species crossed with a horizontal list of sampling sites in which, for each species at that sampling site, the percent cover is given (qualified by date or a master sample ID so we can guarantee that there's only sample per species-sample site, but that's not the question, I can figure that part out).

So, is this this species-sample matrix done with a pivot or some sort of cross apply?

Marc


AnswerRe: Question about pivot Pin
i.j.russell30-Apr-08 13:17
i.j.russell30-Apr-08 13:17 
GeneralRe: Question about pivot Pin
Marc Clifton30-Apr-08 13:38
mvaMarc Clifton30-Apr-08 13:38 
GeneralLeft Join question Pin
Marc Clifton27-Apr-08 2:32
mvaMarc Clifton27-Apr-08 2:32 
GeneralFigured it out Pin
Marc Clifton27-Apr-08 2:46
mvaMarc Clifton27-Apr-08 2:46 
Questiondata joins Pin
Member 470807726-Apr-08 10:26
Member 470807726-Apr-08 10:26 
GeneralRe: data joins Pin
Blue_Boy26-Apr-08 11:22
Blue_Boy26-Apr-08 11:22 
GeneralRe: data joins Pin
Rami Said Abd Alhalim26-Apr-08 20:17
Rami Said Abd Alhalim26-Apr-08 20:17 
Questionsqlserver Pin
Member 470807726-Apr-08 10:09
Member 470807726-Apr-08 10:09 
GeneralRe: sqlserver Pin
Blue_Boy26-Apr-08 10:18
Blue_Boy26-Apr-08 10:18 
GeneralRe: sqlserver Pin
Krazy Programmer26-Apr-08 19:15
Krazy Programmer26-Apr-08 19:15 
GeneralDatabase is locked when executing insert multi row Pin
lvantin26-Apr-08 6:28
lvantin26-Apr-08 6:28 
GeneralAbout Auto Numbers Pin
savitri26-Apr-08 0:16
savitri26-Apr-08 0:16 
GeneralRe: About Auto Numbers Pin
Blue_Boy26-Apr-08 3:51
Blue_Boy26-Apr-08 3:51 
AnswerRe: About Auto Numbers Pin
Ashfield27-Apr-08 7:10
Ashfield27-Apr-08 7:10 
GeneralSchedule a program Pin
yesu prakash25-Apr-08 20:30
yesu prakash25-Apr-08 20:30 
GeneralRe: Schedule a program Pin
Pete O'Hanlon25-Apr-08 23:55
mvePete O'Hanlon25-Apr-08 23:55 
GeneralRe: Schedule a program Pin
GuyThiebaut26-Apr-08 3:41
professionalGuyThiebaut26-Apr-08 3:41 

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.