How to retrieve data from query and link the data to a data number?
i'm doing a project on SQL Server 2005, i'm stack in searching the data and can't link the data in the data number.. can someone help mi with the programming code as i can search for the words in the table but i can't link with the data number..
because some tables inside contain only numbers so i have to search for the keyword and display the result(omim number) and link this result number to a table contain numbers must be identical numbers. it is so hard that i can't really explain well sorry.. my tasks is hard..
i wan to search for the word and it will display the Omim number and the Omim number will link to another identical number to display the description.. can u do it
.Omim_No = cs.Omim_No
AND av.Omim_No = ti.Omim_No
AND av.Omim_No = ti_alt_title.Omim_No
AND av.Omim_No = tx.Omim_No
AND av.Omim_No = OmimVarLocusIdSNP.omim_id
AND (
Description
LIKE '%LIVER%'
OR CS_Description LIKE '%LIVER%'
OR CS_DATA LIKE '%LIVER%'
OR Omim_Titles LIKE '%LIVER%'
OR Omim_Alt_Titles LIKE '%LIVER%'
OR Omim_Text LIKE '%LIVER%'
)
How to retrieve data from query and link the data to a data number?
Ferry Mulyono
am i doing the correct thing this command will search for the keyword LIVER. or issit this command i doing half way through..
SELECT
Omim_NoFROM
avWHERE
Description LIKE '%LIVER%'ORDER
BY Omim_No ASCSELECT
Omim_NoFROM
csWHERE
CS_Description LIKE '%LIVER%'OR
CS_DATA LIKE '%LIVER%'ORDER
BY Omim_No ASCSELECT
Omim_NoFROM
tiWHERE
Omim_Titles LIKE '%LIVER%'ORDER
BY Omim_No ASCSELECT
Omim_NoFROM
ti_alt_titleWHERE
Omim_Alt_Titles LIKE '%LIVER%'ORDER
BY Omim_No ASCSELECT
Omim_NoFROM
txWHERE
Omim_Text LIKE '%LIVER%'SELECT
subsnp_id,pop_id,allele_idFROM
AlleleFreqBySsPopWHERE
source LIKE '%LIVER%'SELECT
aln_idFROM
b125_Alignments_35_1WHERE
tr_acc LIKE '%LIVER%'OR
ctg_name LIKE '%LIVER%'OR
ctg_acc LIKE '%LIVER%'OR
tr_orient LIKE '%LIVER%'SELECT
ctg_id,exon_number,exon_start,exon_endFROM
b125_ContigExon_1_1WHERE
mrna_acc LIKE '%LIVER%'SELECT
ctg_id,exon_number,exon_start,exon_end,seg_start,seg_endFROM
b125_ContigExon_35_1WHERE
mrna_acc LIKE '%LIVER%'SELECT
b125_ContigInfo_1_1.*FROM
b125_ContigInfo_1_1WHERE
contig_acc LIKE '%LIVER%'OR
contig_name LIKE '%LIVER%'OR
contig_chr LIKE '%LIVER%'OR
group_term LIKE '%LIVER%'OR
group_label LIKE '%LIVER%'OR
contig_label LIKE '%LIVER%'SELECT
b125_ContigInfo_34_3.*FROM
b125_ContigInfo_34_3WHERE
contig_acc LIKE '%LIVER%'OR
contig_name LIKE '%LIVER%'OR
contig_chr LIKE '%LIVER%'OR
group_term LIKE '%LIVER%'OR
group_label LIKE '%LIVER%'OR
contig_label LIKE '%LIVER%'SELECT
b125_ContigInfo_35_1.*FROM
b125_ContigInfo_35_1WHERE
contig_acc LIKE '%LIVER%'OR
contig_name LIKE '%LIVER%'OR
contig_chr LIKE '%LIVER%'OR
group_term LIKE '%LIVER%'OR
group_label LIKE '%LIVER%'OR
contig_label LIKE '%LIVER%'SELECT
b125_CrashedInfo.*FROM
b125_CrashedInfoWHERE
snp_type LIKE '%LIVER%'SELECT
b125_MapLink_35_1.*FROM
b125_MapLink_35_1WHERE
snp_type LIKE '%LIVER%'OR
allele LIKE '%LIVER%'SELECT
b125_MapLinkInfo_35_1.*FROM
b125_MapLinkInfo_35_1WHERE
accession LIKE '%LIVER%'SELECT
b125_ModelInfo_35_1.*FROM
b125_ModelInfo_35_1WHERE
tr_acc LIKE '%LIVER%'OR
donor LIKE '%LIVER%'OR
acceptor LIKE '%LIVER%'OR
alignment LIKE '%LIVER%'SELECT
b125_ProjectedSNP_35_1.*FROM
b125_ProjectedSNP_35_1WHERE
snp_type LIKE '%LIVER%'SELECT
b125_ProteinInfo_34_3.*FROM
b125_ProteinInfo_34_3WHERE
ref_seq_status LIKE '%LIVER%'OR
rna_accs LIKE '%LIVER%'OR
prot_accs LIKE '%LIVER%'OR
nucl_accs LIKE '%LIVER%'SELECT
b125_ProteinInfo_35_1.*FROM
b125_ProteinInfo_35_1WHERE
ref_seq_status LIKE '%LIVER%'OR
rna_accs LIKE '%LIVER%'OR
prot_accs LIKE '%LIVER%'OR
nucl_accs LIKE '%LIVER%'SELECT
b125_SNPContigLoc_34_3.*FROM
b125_SNPContigLoc_34_3WHERE
snp_type LIKE '%LIVER%'OR
phys_pos LIKE '%LIVER%'OR
allele LIKE '%LIVER%'SELECT
b125_SNPContigLoc_34_3_dup.*FROM
b125_SNPContigLoc_34_3_dupWHERE
snp_type LIKE '%LIVER%'OR
phys_pos LIKE '%LIVER%'OR
allele LIKE '%LIVER%'SELECT
b125_SNPContigLoc_34_3_fix.*FROM
b125_SNPContigLoc_34_3_fixWHERE
snp_type LIKE '%LIVER%'OR
phys_pos LIKE '%LIVER%'OR
allele LIKE '%LIVER%'SELECT
b125_SNPContigLoc_35_1.*FROM
b125_SNPContigLoc_35_1WHERE
snp_type LIKE '%LIVER%'OR
phys_pos LIKE '%LIVER%'OR
allele LIKE '%LIVER%'SELECT
b125_SNPContigLoc_35_1_ss.*FROM
b125_SNPContigLoc_35_1_ssWHERE
snp_type LIKE '%LIVER%'OR
phys_pos LIKE '%LIVER%'OR
allele LIKE '%LIVER%'SELECT
b125_SNPContigLoc_35_1_ss_fixed.*FROM
b125_SNPContigLoc_35_1_ss_fixedWHERE
snp_type LIKE '%LIVER%'OR
phys_pos LIKE '%LIVER%'OR
allele LIKE '%LIVER%'SELECT
b125_SNPContigLocusId_1_1_temp.*FROM
b125_SNPContigLocusId_1_1_tempWHERE
contig_acc LIKE '%LIVER%'OR
locus_symbol LIKE '%LIVER%'OR
mrna_acc LIKE '%LIVER%'OR
protein_acc LIKE '%LIVER%'OR
allele LIKE '%LIVER%'OR
residue LIKE '%LIVER%'OR
build_id LIKE '%LIVER%'SELECT
b125_SNPContigLocusId_34_3.*FROM
b125_SNPContigLocusId_34_3WHERE
contig_acc LIKE '%LIVER%'OR
locus_symbol LIKE '%LIVER%'OR
mrna_acc LIKE '%LIVER%'OR
mrna_ver LIKE '%LIVER%'OR
protein_acc LIKE '%LIVER%'OR
allele LIKE '%LIVER%'OR
residue LIKE '%LIVER%'OR
build_id LIKE '%LIVER%'SELECT
b125_SNPContigLocusId_35_1.*FROM
b125_SNPContigLocusId_35_1WHERE
contig_acc LIKE '%LIVER%'OR
locus_symbol LIKE '%LIVER%'OR
mrna_acc LIKE '%LIVER%'OR
mrna_ver LIKE '%LIVER%'OR
protein_acc LIKE '%LIVER%'OR
allele LIKE '%LIVER%'OR
residue LIKE '%LIVER%'OR
build_id LIKE '%LIVER%'SELECT
b125_SNPContigLocusId_35_1_old.*FROM
b125_SNPContigLocusId_35_1_oldWHERE
contig_acc LIKE '%LIVER%'OR
locus_symbol LIKE '%LIVER%'OR
mrna_acc LIKE '%LIVER%'OR
mrna_ver LIKE '%LIVER%'OR
protein_acc LIKE '%LIVER%'OR
allele LIKE '%LIVER%'OR
residue LIKE '%LIVER%'OR
build_id LIKE '%LIVER%'SELECT
b125_SNPMapInfo_34_3.*FROM
b125_SNPMapInfo_34_3WHERE
snp_type LIKE '%LIVER%'OR
assembly LIKE '%LIVER%'SELECT
b125_SNPMapInfo_34_3_fix.*FROM
b125_SNPMapInfo_34_3_fixWHERE
snp_type LIKE '%LIVER%'OR
md5 LIKE '%LIVER%'OR
assembly LIKE '%LIVER%'SELECT
b125_SNPMapInfo_35_1.*FROM
b125_SNPMapInfo_35_1WHERE
snp_type LIKE '%LIVER%'OR
md5 LIKE '%LIVER%'OR
assembly LIKE '%LIVER%'SELECT
b125_SNPMapInfo_35_1_ss.*FROM
b125_SNPMapInfo_35_1_ssWHERE
snp_type LIKE '%LIVER%'OR
md5 LIKE '%LIVER%'OR
assembly LIKE '%LIVER%'SELECT
b125_WithdrawCandidates.*FROM
b125_WithdrawCandidatesWHERE
subsnp_id LIKE '%LIVER%'SELECT
Batch.*FROM
BatchWHERE
handle LIKE '%LIVER%'OR
loc_batch_id LIKE '%LIVER%'OR
loc_batch_id_upp LIKE '%LIVER%'OR
batch_type LIKE '%LIVER%'OR
moltype LIKE '%LIVER%'OR
synonym_type LIKE '%LIVER%'OR
linkout_url LIKE '%LIVER%'SELECT
BatchCita.*FROM
BatchCitaWHERE
citation LIKE '%LIVER%'SELECT
BatchCommLine.*FROM
BatchCommLineWHERE
line LIKE '%LIVER%'SELECT
BatchCultivar.*FROM
BatchCultivarWHERE
line LIKE '%LIVER%'SELECT
BatchMeExLine.*FROM
BatchMeExLineWHERE
line LIKE '%LIVER%'SELECT
BatchPrivLine.*FROM
BatchPrivLineWHERE
line LIKE '%LIVER%'SELECT
BatchStrain.*FROM
BatchStrainWHERE
line LIKE '%LIVER%'SELECT
BatchValCode.*FROM
BatchValCodeWHERE
batch_id LIKE '%LIVER%'SELECT
chk_SNPContigLoc_35_1.*FROM
chk_SNPContigLoc_35_1WHERE
snp_type LIKE '%LIVER%'OR
phys_pos LIKE '%LIVER%'OR
allele LIKE '%LIVER%'SELECT
chk_SNPMapInfo_35_1.*FROM
chk_SNPMapInfo_35_1WHERE
snp_type LIKE '%LIVER%'OR
md5 LIKE '%LIVER%'OR
assembly LIKE '%LIVER%'SELECT
Contact.*FROM
ContactWHERE
handle LIKE '%LIVER%'OR
name LIKE '%LIVER%'Saul
you use the LIKE keyword to find data inside strings. You return the ID with the string in the query.
9727604
Roni Tovi
Please tell me this is not one command It's huge.
At it's core, what you're doing is right, using the LIKE keyword.
Wilson Chew
Raoni
first thing is how to search the keywords from the tables
Second thing after u search the result ,how to link the result to a number related to the result
WinFormer
rastsan_caj
What's wrong with this It will return all the data you could hope for. Do you want to generate new IDs, unique to the query and not in the DB
.net and xml newbie
Stephen123
I'm sorry, I do not understand the question. What do you want to do
Steve4527
I don't understand. You're selecting from multiple tables. Don't those tables have ID columns Can't you use those
KnownIssueJosh
SELECT
av.*,cs.*,ti.*,ti_alt_title.*,tx.*,AlleleFreqBySsPop.*,OmimVarLocusIdSNP.*FROM
av,cs,ti,ti_alt_title,tx,AlleleFreqBySsPop,OmimVarLocusIdSNPWHERE
av
.Omim_No = cs.Omim_No AND av.Omim_No = ti.Omim_No AND av.Omim_No = ti_alt_title.Omim_No AND av.Omim_No = tx.Omim_No AND av.Omim_No = OmimVarLocusIdSNP.omim_id AND (Description
LIKE '%LIVER%' OR CS_Description LIKE '%LIVER%' OR CS_DATA LIKE '%LIVER%' OR Omim_Titles LIKE '%LIVER%' OR Omim_Alt_Titles LIKE '%LIVER%' OR Omim_Text LIKE '%LIVER%' )how
ilr
Nothing you're saying makes sense to me. You're selecting multiple tables why can't you just use the same ID, isn't that what you're saying you want
BluestOval
I can't show you an example because I don't know the table schema you're using. You want SQL, right
select id, name from tblSomething where name LIKE '%text%'