Is is possible to use Aggregate functions inside CASE statement?

Database
Enthusiast

Re: Is is possible to use Aggregate functions inside CASE statement?

Hi,

Insert all the distinct records (with all fields) into a new  table and delete the old one is what i feel is easy.

Enthusiast

Re: Is is possible to use Aggregate functions inside CASE statement?

yes u r right kalyan but that is not the case i need to that without using second table can any one help me

Enthusiast

Re: Is is possible to use Aggregate functions inside CASE statement?

yes u r right kalyan but that is not the case i need to that without using second table can any one help me

Enthusiast

Re: Is is possible to use Aggregate functions inside CASE statement?

do you have a time stamp in the table?

Enthusiast

Re: Is is possible to use Aggregate functions inside CASE statement?

Hi,

First create the backup of the table as a standby -- Very important

Set the Primary index with concatenation if it is more than one field

use  your dbname....

del from yourtablename

where primary index column in

(

sel primary index column from yourtablename

qualify row_number()over(partition by primary index order by some column) > 1

)

.. This  will keep one record and deletes all the other. you do not need to create any seperate table for this

Hope this may serve the purpose

Highlighted
Enthusiast

Re: Is is possible to use Aggregate functions inside CASE statement?

Thanks kalyan

Enthusiast

Re: Is is possible to use Aggregate functions inside CASE statement?

hi,

 i have one doubt that is on which basis we need to set the nuber of sessions for a script etheir 6 or 8 or ....

in any utility can you please help

Junior Contributor

Re: Is is possible to use Aggregate functions inside CASE statement?

Hi Ram,

you should create new topics for new questions:

Go to the appropriate forum, at the top or bottom of the page there's a "create new forum topic"

Dieter

Re: Is is possible to use Aggregate functions inside CASE statement?

hi frnds ,

  1. I ve table like dis table name is EMPL

NAME      DOB    AGE

-------------------------

K.hema   12thmarch 22

d.Hari   7thmay    35

k.kannan 2 apr     55

K.kannan 6 july    55

g.hema   12 march  31

d,hari    7 may      35

here employee id not given, such cases ve same name,same age,same dob den how to make a query for giving random number for empolyees.....

Re: Is is possible to use Aggregate functions inside CASE statement?

em the beginner of MS-sql any one can help.... other wise give query in oracle