Patindex

External Article

PATINDEX Workbench

  • Article

The PATINDEX function of SQL Server packs powerful magic, but it is easy to get it wrong. Phil Factor returns to the Workbench format to give a tutorial of examples, samples and cookbook ideas to demonstrate the ways that this underrated function can be of practical use. It is intended to be pasted into SSMS and used as a basis for experiment.

2011-05-23

5,331 reads

Technical Article

RE: excluding fields in my SELECT from the GROUP BY clause

  • Reply

HelloReplie for Antares686 as requested : NdocNmdocCodigoQtPvValorValor_custoDescMargemComissão1Factura             20180ANB-1        12568,3510487,67787,20+0                  25,74861Factura             20180ANB-2        24008,3520040148800+0                  25,74861Factura             22520ANB-1        15008,25123758572,54950+0                  30,72691Factura             22520ANB-2        15008,251237585800+0                  30,66671Factura             24020ANB-1        25005125008581,85250+0                  31,34521Factura             24020ANB-1        31005,51705010641,49710+0                  37,58661Factura             24040ANB-1        13008104006290,67010+0                  39,51281Factura             24040ANB-2        12008960061200+0                  36,251Factura             24040ANB-3        860868804162,40+0                  39,51Factura             24040ANB-4        150081200076500+0                  36,251Factura             24520ANB01-04     310061860011791,07010+0                  36,60721Factura             27640ANB-1        420625201377,60+0                  45,33341Factura             27640ANB-2        1290677404231,20+0                  45,33341Factura             27670ANB-1        32006192009123,92960+0                  52,47961Factura             27670ANB-2        22006132007026,55140+0                  46,76861Factura             27670ANB-2        24006144007665,32880+0                  46,76861Factura             27730ANB-1        10805,4583231860+0                  45,37041Factura             27730ANB-2        8205,4442824190+0                  45,37041Factura             PRV108-1          351072457018145,310040+0                  26,14861Factura             PRV108-2          48007,937920278880+0                  26,45571Factura             PRV108-3          70007,95530041006,8820+0                  25,84664Nota de Crédito     NSINDEMNIZ        112000-12000-0,652870+0                  0-4804Nota de Crédito     NSRAPPEL          141217,49-41217,4900+0                  0-1648,69960                                      0000                     0029                                      4693853362,79274200,11217126,3883                     775,8179-2128,6996that is the result , but i need the result like this :for this Client i need only one line with the SUM of "Valor" ; "Valor_custo";"Comissões"and "Margem" , where "Valor" as Sails;"Valor_custo" as Cost; "comissões" as comissions and "margem" as benefits.I hope you understand better […]

You rated this post out of 5. Change rating

2005-01-11

Technical Article

DROP on a culumn with constraint

  • Topic

The culumn from_core was created by a program that execute this code:ALTER TABLE WebRsLog ADD [from_core][bit] NOT NULL DEFAULT 1Now I need to drop this column. Using the code:ALTER TABLE WebRsLog DROP COLUMN [from_core]I get the error:The object 'DF__WebRsLog__from_c__7C86175C' is dependent on column 'from_core'.So, I need to drop the constraint first. A problem - the name […]

You rated this post out of 5. Change rating

2004-10-11

3 reads

Blogs

Real-World SQL Mastery: Your Hands-On, Mess-Free Sandbox

By

Are you ready to take your SQL skills from theoretical to tactical? If you've...

Set a Runtime Variable in an Azure DevOps Pipeline

By

Note: I DO NOT recommend this. Any changes to a pipeline should be in...

A New Word: Symptomania

By

symptomania – n. the fantasy that there’s some elaborate diagnosis out there that neatly...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers