| re: sql problem - how to write this in sql
Foxie,
Sorry, but I'm having a hard time understanding what you're asking. Did
that query I wrote not work? What happened? What results do you want to
see?
Post your table structures and maybe it'll be more clear.
"Foxie Foxster" <verik.reynaert@skynet.be> wrote in message
news:3fcf69d8$0$279$ba620e4c@reader4.news.skynet.b e...[color=blue]
> thx for reply
>
> so in the order it is possible to calculate
>
> and well
>
> order SUM(points)
>
> though that doesn't work with me......
>
> must there be a calculation after the SELECT WORD????
>
>
> "DFS" <nospamDS@nospam.com> schreef in bericht
> news:vsugr61eumbqd0@corp.supernews.com...[color=green]
> > I think you want something like:
> >
> > SELECT L.LevName, Sum(P.Points1) as SumPoints1, Sum(P.Points2) as[/color]
> SumPoints2[color=green]
> > FROM tblLEV L INNER JOIN tblPOINTS P
> > ON L.LevID = P.PointsID
> > GROUP BY L.LevName
> > ORDER BY Sum(P.Points1) DESC
> >
> >
> > "Foxie Foxster" <verik.reynaert@skynet.be> wrote in message
> > news:3fcf2d72$0$2871$ba620e4c@reader1.news.skynet. be...[color=darkred]
> > > i have two tables nl tblLEV and tblPOINTS (each with a certain[/color][/color][/color]
number[color=blue][color=green]
> > of[color=darkred]
> > > fields)
> > >
> > > now i wrote the following sql
> > >
> > > sqltekst= "SELECT DISTINCTROW tblLEV.LEVname, tblPOINTS.* from tblLEV[/color]
> > inner[color=darkred]
> > > join tblPOINTS ON tblLEV.levid=tblPOINTS.pointsid ORDER BY levpt DESC,
> > > levpt1 DESC
> > >
> > >
> > > comment: levpt en levpt are fields from table tblLEV and the ordening[/color]
> > works[color=darkred]
> > > fine
> > >
> > > but now the problem.......................
> > >
> > > there are numeric fields in tblPOITS points1, points2 and I want to[/color]
> > complete[color=darkred]
> > > the order with
> > >
> > > sum(points1) DESC, sum(points2) DESC
> > >
> > >
> > > questions:
> > > in qsl is summating sum(points)????
> > > if not how is it done????
> > >
> > > can anyone understand what i'm saying or give me some advice???
> > >
> > > thx and greetigns
> > >
> > >[/color]
> >
> >[/color]
>
>[/color] |