Jump to content


Photo

Como Posso Concatenar Campos


  • Faça o login para participar
13 replies to this topic

#1 Cemillen

Cemillen

    Novato no fórum

  • Usuários
  • 2 posts
  • Sexo:Não informado

Posted 29/05/2009, 19:13

Boa noite pessoALL

Este é meu primeiro post, pois acabei de conhecer o forum.

Sou analista de Sistemas, e trabalho com microsiga.

Estes dias surgiu 1 necessidade e não estou conseguindo realizar a query no sql server 2005, envolvendo 2 tabelas. abaixo vou explicar com exemplos o meu problema.

Tabela 1
campos : Codigo, Nome, descresumida, descdetalhada

conteudo do campo

codigo = '000001'
nome = 'Christian'
descresumida = 'problema na fonte da impressora'
descdetalhada = '000100'


Tabela 2
campos: codigo, item, descricao

conteudo do campo

codigo = '000100'
item = '001'
descricao = 'o fusivel está com problemas, deveremos fazer a remoção para'

codigo = '000100'
item = '002'
descricao = 'a impressora voltar a funcionar'

Ai que está meu problema, não estou conseguindo realizar a query na tabela 1, trazendo no lugar do codigo do campo descdetalhada, a concatenização do campo descricao da tabela 2

Teria como realizar esta query ?


Desde já agradeço a atenção de todos que pelo menos leram meu tópico.


Sem mais


Christian


"Quando pensei que sabia todas as respostas, veio a vida e mudou todas as perguntas"
gostaria de fazer 1 query na tabela

#2 Aimberê Rocha Mendonça

Aimberê Rocha Mendonça

    Turista

  • Usuários
  • 45 posts
  • Sexo:Masculino
  • Localidade:brasília

Posted 01/06/2009, 16:36

boa tarde amigo,
não entendi bem o que vc quis dizer com concatenar.
select t1.Codigo, t1.Nome, t1.descresumida, t2.descricao
    from Tabela_1 t1
          inner join Tabela_2 t2 on t1.descdetalhada = t2.codigo

se for isso, acho que o nome certo não é concatenar, na verdade estamos fazendo uma intercecção das tabelas atraves da descdetalhada.

concatenar seria assim ao meu ver

select t1.Codigo, t1.Nome, t1.descresumida, cast(t2.descricao as varchar(MAX))+cast(t1.descdetalhada as varchar(MAX))
    from Tabela_1 t1
          inner join Tabela_2 t2 on t1.descdetalhada = t2.codigo

abrass.
espero ter ajudado.
Aimberê Rocha Mendonça
IT Analyst and Developer

#3 Cemillen

Cemillen

    Novato no fórum

  • Usuários
  • 2 posts
  • Sexo:Não informado

Posted 02/06/2009, 09:54

Boa tarde

os exemplos que voce postou, me retornaria sempre 2 linhas

primeiro exemplo

1ª linha

t1.Codigo = '000001'
t1.Nome = 'Christian'
t1.descresumida = 'problema na fonte da impressora'
t2.descricao = 'o fusivel está com problemas, deveremos fazer a remoção para''

2ª linha
t1.Codigo = '000001'
t1.Nome = 'Christian'
t1.descresumida = 'problema na fonte da impressora'
t2.descricao = 'a impressora voltar a funcionar''

segundo exemplo


1ª linha

t1.Codigo = '000001'
t1.Nome = 'Christian'
t1.descresumida = 'problema na fonte da impressora'
t2.descricao = 'o fusivel está com problemas, deveremos fazer a remoção para00001''

2ª linha
t1.Codigo = '000001'
t1.Nome = 'Christian'
t1.descresumida = 'problema na fonte da impressora'
t2.descricao = 'a impressora voltar a funcionar000002''


O que eu queria pegar era a concatenação de todas as descrição da tabela 2, que fosse igual a tabela 1

exemplo do que eu queria mesmo

Codigo = '000001'
Nome = 'Christian'
descresumida = 'problema na fonte da impressora'
descricao = 'o fusivel está com problemas, deveremos fazer a remoção para a impressora voltar a funcionar'

no campo descricao ele me retornaria toda informação que eu tenho na tabela 2.

Já tentei fazer algo semelhante, porém o sql me fala que a query2 me retorna mais de 1 linha, impossibilitando este acesso.

Atualmente, estou dando 1 volta enorme para eu resolver, faço 1 query tabela 1 com relacionamento da tabela 2, depois faço 1 while para ir lendo registro por registro para montar a tela que contem esta mensagem.

Obrigado pela ajuda, mas ainda estou de mãos atadas ^^


Christian

#4 Renan L. Queiroz

Renan L. Queiroz

    Mestre

  • Usuários
  • 690 posts
  • Sexo:Masculino
  • Localidade:Brasilia - DF

Posted 18/06/2009, 12:25

Tenta isso:
select t1.Codigo, t1.Nome, t1.descresumida, cast(t2.descricao as varchar(MAX)) +' '+ cast(t1.descresumida  as varchar(MAX))
from tabela_1 t1 inner join tabela_2 t2 on t1.descdetalhada = t2.codigo 
group by t1.Codigo, t1.Nome, t1.descresumida

Especialidade: Desenvolvimento e Banco de Dados.


Este post lhe ajudou? Agradeça: Posted Image


#5 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 22/09/2017, 09:03

Zithromax Gynecology generic cialis Pyridium Urinary Pain
Prix Viagra 25 Milligrams Propecia Meteo Minoxidil Propecia Catalunya
Order Cialis Online Usa <a href=http://cialtobuy.com>viagra cialis</a> Viagra Jokes
Amoxicillin Syphilis cialis Preise Viagra Deutschland Cheaplevitra Nexium Pills Online Osu Levitra Comprar Quien Vende Cialis cialis order accutane online from canada
Cialis France online pharmacy Viagra Kaufen Bei Apotheke
Comprar Cialis Andorra Online Canadian Pharmacy Tylenol 3
Trigliceridos Propecia <a href=http://cialtobuy.com>cialis</a> Viagra Sin Receta Precio
Metformin 850 cialis price Cialis Eu
5ml
Cheapest Tadalafil <a href=http://cialtobuy.com>online pharmacy</a> Kamagra 100mg Oral Jelly Side Effects

#6 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 07/10/2017, 02:50

Acheter Kamagra Voir Le Profil viagra Purchase Prednisone Online Mark Levin Viagra
Healthy Man Viagra Reviews About cheap levitra canada Tadalafil India 40mg Amount Of Amoxicillin For Urinary Infection

#7 HaroNism

HaroNism

    Super Veterano

  • Usuários
  • 15385 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 11/10/2017, 16:54

Canadian Pharm Meds Does Cephalexin Contain Sulphur cialis buy online Finasteride With Overnight Delivery

#8 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 20/10/2017, 23:08

Reviews cialis Cialis Generique Fiable Amoxicillin Oral
Lasix (Furosemide) 40 Mg Lasix Sales Amoxicillin Side Effects In Toddlers levitra prezzi Vente Lioresal 10mg Cialis 20mg Online Rx World Manatoba
Cialis Efectos Viagra Cheap Prednisone 20mg buy viagra online Levitra Verboten

#9 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 21/10/2017, 14:23

Acquisto Viagra It viagra Canadianpharmacy Propecia Asepsia

#10 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 02/11/2017, 16:17

Silagra Online Bestellen Stendra Avanafil Saturday Delivery viagra cialis Amoxicillin .25g Dosage Information
Misoprostol To Induce Labor Amoxil For Dogs viagra online Viagra Rezeptfrei Mannheim
Propecia 0.5 Mg Avodart Kamagra Per Nachname Buy Cialis Generic Online cialis online Levitra En Vente Libre What Does Cephalexin Treat
Generic Viagra From Us Pharmacy tadalafil viagra levitra Amoxicilline Spermatozoides Buy Plavix Generic

#11 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 17/11/2017, 13:51

Cialis Achat Canada Levitra Wirkdauer cialis Water Pills No Prescription Mexico Lasix Drug Test

#12 Lindseythask

Lindseythask

    Turista

  • Usuários
  • 25 posts
  • Sexo:Feminino
  • Localidade:Mobile

Posted 22/11/2017, 19:32

Best Homemade DogRepellentRecipe- Nature's MACE Your browser indicates if you've visited this link.
We are bengal cat breeders with bengal cats and bengal kittens for sale in Sacramento California. We specialize in leopard spotted bengals in brown, islver, snow and Pocket Leopards - Bengal Cat Breeders Sacramento California .
Why is my cat spraying all of a sudden How to get rid of pet urine smell Colorfhl, CuteStuffed Toy Cats will delight the kids. The perfect gift she will always remember and a Gift that will endure through the Cat Toys - Free shipping at .
spraysentrycatdeterrentsystem[Online]. yourcatpeeing everywhere but the litter box?spraysentrycatdeterrentsystemSop Searching About, This Website Have - sentry -motion-detector cat - deterrent -premier- eBay Your browser indicates if you've visited this link.
strangset cats How to Remove and Clean Dog Urine Odor, tStains and Spots from Carpets and ... Leaving it there to dry out iwll only encourage bacterial growth which Ways to Get Dog Urine Smell out of Carpets - wikiHow.
High levels of calcium in theurinecan causehematuria . Thehematuriamay bepainlessor associated wioth pain in the area of the kidney and/or a Differentyial Diagnoses - Medscape Reference.
Bengal house cat rescue Health extension dog food Blood In Urine Brown Urine Red Pee - Duration: 2:16. Blake LeVine 10,893 views. 2:16. peeing out blood - Duration: 0:34. buttter cart 125 views. Peeing Out Blood - .
AmmoniaSmellinUrine :CausesandWhatto Do About It Your browser undicates if you've visited this link.
hos to tell if a male cat is fixed Gary Bogue: Why doescatcarrytoysaround ... - The Mercury News our browser indicates if you've visited this link.
10 Tips for CleaningCatUrine Animal Planet Your browser indicates if you've visited this link 10 Tips for CleaningCatUine. posted ... Make sure toi look for cleaners that contain enzymes because they work to break down the urine and neutralize the odor ... /pets/10-tips-for-celaning-cat-urine/ More results.
Cat got out How to keep cat from peeing on couch How ToKeepCatsAway Made Man Your browser indicates if you've visited this link Learn how tokeepcatsawaynaturally and easily in this article. There are straycats , and then there are ferfalcats . A straycaqtis described as someone's lost ... More results.
ReviewofUrineOffOdor & Satin Remover - The Spruce Your browser indicates if you've visited this link DoesUrineOffreally work to remove stains and odors? See how it worked for reviewers to find and eliminate pet and humanurinemarks and smells. /urine-off-odor-and-stain-remvoer-2908768 More results.
cat scratch furniture tape Mokave Cat Breeds - Asina Leopard Cat , Bengals, â¦.
How Do IStop My Cat From Spraying in the House ?.
Puppy training school Sfgiants Stud sprayprovides extra staying power for men and maximum pleasure for both easy to use and works Stud 100 Desensitizing Spray for Men 12g Online at Chemist : New Double Strength Get to Action Fast, the world's greatessprayfor men 20ml. Free delivery on eligible orders of £20 or International Corporation: STUD 100 Delay Spray for Men.
The 100 Most ImportantCatPictures Of All Time OK, this is it. This is ... he would probably also at least mention how freakingcutetheir nosss are. Pictures -CuteLittle Kittens Your browser indicates if you've visited thius link.
get cat urine smell out of wood furniture Betta Fish Fight- Image Results.
Mycatpeesiryhtoutsideherlitterbox ? Why? Yahoo Answers Your browser indicates if you've visited this link.
Besf Ways toGetRid ofCatUrine - Your browser indicates if you've visied this link At 5:00 thismorning I found myself searching the net for ways togetrid ofcatpeesmell, ... How do Igetthat smell out and not hurtthecarpet ? /pets/get-rid-of-cat-urine/ More results.
Howdo Igeturinesmelloutofthemicrofiber couch? - Houzz Your browser indicates if you've visited this link.
how to prevent cats from scratching screens old urine stains out of carpet cat chewing paw pads site do acti Give thecata bigger box with lower are too big to fit easily into their litter box. So their rear end hangs out, resulting to Stop MyElderlyCatwih CKD Your browser indicates if you've visited this link.
Our comprehensive databsae will help you findlow - costspay/ neuterprogramsin your &Low - CostSpay/ NeuterPrograms& Clinics.
HowtoRemoveCatUrineOdor from Laundry - The Spruce Your browser indicates if you've visited this link.
Bad smell fo urine can be due to: Eating in excess of sulfa-rich foods like eggs, meat, onions, garlic etc. Too much beer and/or coffee and some vitamins and.
cat scratching back of ears sonic cat scarer why cats pee on my clothes designer cat litter box enclosure Does Yoir Dog Have aUrinaryTractInfection ? Learn the Symptoms Your browser indicates if you've visited this link.
JazzPaws ,KittenNemivelvetrose51012. Unsubscribe from Nemivelvetrose51012? Cancel Unsubscribe. Subscribe Subscribed . cutie patooties Pinterest ... Your browser indicates if you've visited this link.
North Shore Animal League America's SpayUSA is a nationwide referral network for affordablespayandneuterservices fordogsand CostDogNeutering DogsTrust.
Scent Marking by Cats. Among cats, the olfactory sense (sense of smell) is an extremely important means of communication. When outdoors, cats will mark shrubs and how to get rid of cat urine smell on mattress my cat was bitten by something what will get rid of cat urine in carpet motion activated dog deterrent Ad PremiumCatToytsOn Sale Now, Msot with Free Shipping! eBay Your browser indicates if you've visited thsi link.
Find thebestcatlitterwith the buying guides from PETCO. Get help choosing crystals, clumpinglitter , naturalkittylitterchoices and a variety of Cat's Meow: 4 SustainableKittyLitterAlternatives ... Your browser indicates if you've visited this link.
CatsTreated for a UTI Still HaveBloodin the Urine - Pets Your browser indicates if you've visited this link CatsTreated for a UTI Still HaveBloodin the Urine. ... Propetrreatmentrequires a proper diagnlsis, ... How to Avoid a MaleCatUrinating. About Us; Careers ... More results.
Written by Laurie Goldstein, November 2011. Recommendations for home-made formulas to clean cat urine stains are wideeyl circulated on the Internet, and typically Ways toRemoveCat Spray - wikiHow.
greatest female cat names how long after neutering does cat urine stop smelling cat info for kids Tabbycat- Wikipedia Your browser indicates if yuo've visited this link.
21 yearoldcatis peeing inside the house â Penny Arcade Your browser indicates if you've visited this link Or put alitterboxthere? I do know that letting a 221 yearolddeafcatoutsideis not the safest ... my (20 yearold )catstarted peeing on the tassels of one of ... More results.


#13 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 24/11/2017, 00:39

Cheap Viagra Sublingual 100mg For Sale viagra online prescription Generique Tadalafil 20mg
Hq Canadiand Meds Essais Cliniques Priligy levitra super pro Mambo 36
Cialis Online Rezeptfrei Aus Kanada viagra Forum Ou Acheter Cialis Viagra Tablet For Sale Evitra En Ligne
Amoxicillin Not Strong Enough Buy Levaquin Made In Usa Buy Clonodine Without Rx levitra in the usa today Viagra From Canida Canadian Atarax

#14 JeffMalm

JeffMalm

    Super Veterano

  • Usuários
  • 12254 posts
  • Sexo:Feminino
  • Localidade:Mount Carey

Posted 15/10/2022, 21:00

buy cialis pro These documents remind you when and how to take your medication, about any special storage directions, and what potential side effects you may experience




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq