![]() |
![]() |
|||
|
||||
|
|||||||
| Register | Forum Rules | FAQ | Search | Today's Posts | Mark Forums Read |
| Welcome Guest Visitor! Please Register, It's Free and Fun To Participate! | |
|
The EXTREME Overclocking Forums are a place for people to learn how to overclock and tweak their PC's components like the CPU, memory (RAM), or video card in order to gain the maximum performance out of their system. There are lots of discussions about new processors, graphics cards, cooling products, power supplies, cases, and so much more!
You are currently viewing our boards as a "guest" which gives you limited access to view most discussions. You need to register before you can post: click the register link to proceed. Before you register, please read the forum rules. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own pictures, and access many other special features. Registration is fast, simple, and absolutely free! To start viewing messages, select the forum that you want to visit from the selection below. After you have registered and read the forum rules, you can check out the FAQ for more information on using the forum. We hope you enjoy your stay here! Note To Spammers: We do not allow unsolicited advertising! Spam is usually reported & deleted within minutes of it being posted, so don't waste your time (or ours)! |
|
| Please Register to Post a Reply |
|
|
Thread Tools |
|
|
#1 | ||||
|
Waldeinsamkeit
Senior Member
|
SQL Question
Code:
`os`.`site_distance` AS `Distance`, |
||||
|
|
|
|
#2 | ||||
|
Old School
Senior Member
|
Hmmm, need version of SQL (like Oracle, MySQL, whatever) and the complete statement. My first guess puntuation error. Or the ending comma changed the query but passed parsing/syntax checking.
|
||||
|
|
|
|
#3 | ||||
|
Waldeinsamkeit
Senior Member
|
view with the statement in it:
Code:
CREATE
ALGORITHM = UNDEFINED
DEFINER = `rpokeefe`@`%`
SQL SECURITY DEFINER
VIEW `METAGENO`.`COMP_REPORT_2` AS
select
`g`.`id` AS `MH_gene_id`,
`g`.`Name` AS `MH_name`,
`f`.`Path` AS `MH_file`,
`sc`.`Name` AS `MH_scaffold`,
`g`.`Operon` AS `Operon`,
`o`.`prime_gene` AS `Operon_Prime_Gene`,
`os`.`site` AS `Site`,
`os`.`site_type` AS `Site_Type`,
`os`.`site_distance` AS `Site_Distance`,
`s`.`Score` AS `Site_Score`,
`m`.`name` AS `Motif`,
`gort`.`ortho` AS `ORTHO_NCBI_gi`,
`gort`.`eval_coef` AS `GENE_ORTHO_E_coef`,
`gort`.`eval_power` AS `GENE_ORTHO_E_power`,
`rgi`.`gi` AS `COG_NCBI_gi`,
`ortcp`.`eval_coef` AS `ORTHO_COG_E_coef`,
`ortcp`.`eval_power` AS `ORTHO_COG_E_power`,
`rgi`.`accession` AS `NCBI_Accession`,
`rgi`.`description` AS `NCBI_Description`,
`rgi`.`product` AS `NCBI_Product`,
`cpc`.`cog` AS `COG`,
`c`.`Name` AS `COG_Description`,
`cpc`.`cogprot` AS `COG_Protein`,
`cpc`.`cog_org` AS `COG_Protein_organism`,
`cfg`.`id` AS `COG_Group`,
`cfg`.`Desc` AS `COG_Group_Description`,
`co`.`taxid` AS `Tax_id`,
`co`.`name` AS `Organism_Name`,
`s`.`Sequence` AS `Site_Sequence`
from
(((((((((((((((`METAGENO`.`GENE` `g`
join `METAGENO`.`FILE` `f`)
join `METAGENO`.`SCAFFOLD` `sc`)
join `METAGENO`.`OPERON` `o`)
join `METAGENO`.`OPERON_SITE` `os`)
join `METAGENO`.`SITE` `s`)
join `METAGENO`.`MOTIF` `m`)
join `METAGENO`.`GENE_ORTHO` `gort`)
join `METAGENO`.`ORTHO` `ort`)
join `METAGENO`.`ORTHO_COGPROT` `ortcp`)
join `METAGENO`.`COGPROT_COG` `cpc`)
join `METAGENO`.`COG` `c`)
join `METAGENO`.`COG_GROUP` `cg`)
join `METAGENO`.`COG_FUNCTIONAL_GROUP` `cfg`)
join `METAGENO`.`REF_GENE_INFO` `rgi`)
join `METAGENO`.`COG_ORG` `co`)
where
((`g`.`Operon` = `o`.`id`)
and (`o`.`File` = `f`.`id`)
and (`o`.`Scaffold` = `sc`.`id`)
and (`o`.`id` = `os`.`operon`)
and (`os`.`site` = `s`.`id`)
and (`s`.`Motif` = `m`.`id`)
and (`g`.`id` = `gort`.`gene`)
and (`gort`.`ortho` = `ort`.`ortho`)
and (`ort`.`ortho` = `ortcp`.`ortho`)
and (`ortcp`.`cogprot` = `cpc`.`gi`)
and (`cpc`.`gi` = `rgi`.`gi`)
and (`cpc`.`cog` = `c`.`id`)
and (`cpc`.`cog` = `c`.`id`)
and (`c`.`id` = `cg`.`COG`)
and (`cg`.`GROUP` = `cfg`.`id`)
and (`cpc`.`cog_org` = `co`.`cog_org`))
group by `gort`.`ortho`
having max(`os`.`site`)
Code:
select * from METAGENO.COMP_REPORT_2 where (Motif = "Gamma") Additional Comment: The only addition is the statement I had in the first post, everything else is the same. I really don't understand why this would change. It is sort of worrying me because I thought I had a fairly firm grasp on how this view was working Rows returned without statement: 2700 Rows returned with statement : 2691 It might seem like a small amount but this isn't exactly data where we can fudge things. Additional Comment: I've checked through all of the data returned be each version of the view with the above SQL query. The vast majority of results were the same however each version brought back data that the other one did not. I've pulled up everything on those entries and the "Site_Distance" value for the different entries isn't null or anything. I'm really lost on this. ![]() Additional Comment: Even weirder, I changed the group by statement from Code:
group by `gort`.`ortho` Code:
`g`.`id` Last edited by zlander79 : 08-17-2012 at 03:55 PM. Reason: Automerged Doublepost |
||||
|
|
|
|
#4 | ||||
|
Old School
Senior Member
|
Hmmm, does column name 'Motif' exist in any of the other tables in the query?
The two different GROUP BY clauses might return (probably would return) a different number of rows. I see no reason why simply adding another column to the select clause would change the number of rows returned (in Oracle and DB2 it would NOT). You sure the two different views executed against the same schema on the same host? |
||||
|
|
|
|
| Please Register to Post a Reply |
| Thread Tools | |
|
|