Finding duplicate values in a column with different values in a different c

I'm finding duplicate values in a column of my table:
select ba.CLAIM_NUMBER from bsi_auto_vw ba
group by ba.CLAIM_NUMBER
having count(*) > 1;
How can I modify this query to find duplicate values in that column where I DON'T have duplicate values in a different specific column in that table (the column CLMT_NO in my case can't have duplicates.)?

Well, you can use analytics assuming you don't mind full scanning the table.....
select
   count(owner) over (partition by object_type),    
   count(object_type) over (partition by owner)
from all_objects;You just need to intelligently (i didn't here) find your "window" (partition clause) to sort the data over, then make use of that (the analytics would be in a nested SQL and you'd then evaluate it in outside).
Should be applicable if i understand what you're after.
If you post some sample data we can mock up a SQL statement for you (if what i tried to convey wasn't understandable).

Similar Messages

  • One Key FIgure in more than one column with different restrictions

    Hi,
      I am using a key figure in more than one column with different restrictions, but restriction in one column is affecting the result in other column. What shall i do to make it independent from one another??

    Hi Pravender Chauhan,
        If you want in Single column different value for different Rows based on same Key Figure, you can create Structure where you can define different logic for each row but using same key figure.
    If you want to use different Key figures then you should have to Restricted Key Figure and for any calculation you can use calculated Key figure.
    Assign points if Useful.
    Regards,
    Rajdeep.

  • Duplicate entry posted in FB60 with different referance number

    how to find out duplicate entry posted in fb60 with different reference number in same vendor.

    Dear,
    the question is not so clear; try by se11 --> BSEG table using Your vendor and other details...
    I hope this helps.
    Mauri

  • Find duplicate values in a vector???

    Hi,
    Can somebody help me please?????
    I have a little problem, but I can't find it :-(
    I have a vector with a lot of values,
    The question is, how can I find duplicated values?
    Vector VNumber = new Vector();
    VNumber.addElement(Bknm);
    /**Bknm->values read out of a file**/
    for(int j=0;j<VNumber.size();j++){
    System.out.printl("Bknm = " + Bknm.elementAt(j));
    /**code for find duplicate values????**/           
    }

    Its much easier to check items as they are going in, rather than parsing the Vector and finding dupes.
    Vector VNumber = new Vector();
    while(true)
       // Read next Bknm object here
       if(!VNumber.contains(Bknm))
          VNumber.add(Bknm);

  • How can I setup an .indd with two columns with different threads so that I can export to epub?

    Hi all. Sorry, english is not my native language. I´ve made an .indd: each page has two columns with different threads (is a bilingual text). When I export this .indd to .epub only appears one column from a thread following the next thread. What can i do to fix this? My indesign is CS6
    Thank you

    There are fixed format EPUB files as can be used for children's books, etc. where there are a lot of illustrations. However, those are very work-intensive to produce. I've never worked on one.
    Anne-Marie Concepcion did a Lynda.com video on producing one.
    Rorohiko produces a product called ePubCrawler which can help in produced fixed format EPUB files:
    Fixed Layout EPUB Assistant In InDesign: ePubCrawler | Rorohiko ...

  • How to find users who are running IE with different credentials ?

    How to find users who are running IE with different credentials ? 
    Is there any tool or a solution in the market will help or a i can use GPO or even Power Shell ?
    thnx & Regards ,,

    Hi Salman,
    Based on your description, we can use Windows Credential Manager to check this. Windows Credential Manager stores credentials, such as user names and passwords  that we use to log on to websites or other computers on a network.
    Regarding Credential Manager, the following article can be referred to for more information.
    Credential Manager
    http://windows.microsoft.com/en-in/windows7/what-is-credential-manager
    Manage passwords in Internet Explorer using Credential Manager
    http://www.thewindowsclub.com/manage-passwords-internet-explorer-10
    Please Note: Since the above website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Best regards,
    Frank Shen

  • How to update a column with different values but all other row values r sam

    Hi,
    I have a table like this.
    Col1 col2 col3 col4
    10 20 30
    10 20 30
    10 20 30
    i need to update col4 with different values coming from other table like this
    Col1 col2 col3 col4
    10 20 30 xxxx
    10 20 30 yyyy
    10 20 30 zzzz
    how can i update the table. pls let me know how to use the where condition in the update stmt.
    thanks,
    jay
    Edited by: user2558790 on Nov 20, 2009 12:26 PM

    what is the logic for this kind of update...????
    Greetings,
    Sim

  • Path Finder in a 2D Grid Map With Different Terrain Types

         I have been thinking for a while on path finding game algoritms and I can up with one idea witch I want to publish. The goal of my project is when I have a 2 dimensional grid map where squares can have different movement cost, like in Civilization II, to find the shortest way from one point in the map to another. I've used the Breathed First Search Engine. If you are not familiar to this search engine it is better to read about it first because I am not fcusing on it and I assume that you now how it works. You can read about it at the book "Practical Artificial Intelligence Programming in Java" writen by Mark Watson, witch is freely distributed at www.markwatson.com.
         Actually the idea of this 2D grid path finder is to use a third dimension witch have a size equal to the highest movement cost among all terrain types. This helps solving the problem with the different movement cost of the squates. By adding this abstract third dimension it is posible to use the Breadth First Search Engine.
         I this example the movementcost of a terrain type is always the same, no matter from witch square to with are you going (like in Civilization II but I haven't included roads or railroads). For example if you want to go from one square A to another square B with movement cost X (A and B are attached) you must go "up stairs" in the third dimension X - 1 times and then move to square B. But when you step on square B you are again at the lowest floor. So if you want to come back to the previous square A and it have movement cost Y first you must go floor Y and then jump in square A. And now you are again at the lowest floor at square A. When you move from one square to another you go always at the lowest floor. This is the way I handle with different movement costs.
         When you find the path to the goal point it is in 3 dimensions. So you must just project it in the 2D map and that's all you have the shortest path.
         I am sure this is not the best way to code this search engine but this is just the first scratch with no optimisation and so on. If I make a 100x100 randomly generated map it takes on my configuration(400Mhz Pentium II CPU with ASUS P2B MotherBoard on 100 MHz and 256 MB SD RAM on 133 MHz but because of my MB on 100MHz) around 1000 miliseconds (1000 miliseconds = 1 second) to find the shortest path from (1, 1) to (100, 100) witch is pretty good compare to the goTo function in Civilization II witch does not finds the shortest path at all and have made hundrets of gamers angry. This is amazing that nowadays there are so many games with bad path finding.
         This project includes:
    1. The PathFinder class witch does the jub.
    2. The Map class witch has a generator for a random map in it.
    3. The class TerrainType, every square on the map is based on this class.
    4. The class TerrainTypes witch is the set of all terrain types used in the map.
    5. The class PathFinderTest witch just test the path finder.
    To test this project put all files in one directory and run PathFinderTest.java.
    Map.java:
    import java.util.Vector;
    import java.util.Random;
    //This class just creates a random map and keeps it. I will not comment on this.
    class Map {
      //here is kept the information about the terrain types placed in the map. Where
      //every terrain type has a specific movement cost.
      private int[][] terrain;
      public TerrainTypes terrainTypes;
      private int landMass;
      private int width;
      private int height;
      private int highestMovementCost;
      public Map(int aWidth, int aHeight) {
        width = aWidth;
        height = aHeight;
        terrainTypes = new TerrainTypes();
        highestMovementCost = terrainTypes.getHighestMovementCost();
        terrain = new int[width][height];
        landMass = 0;
        generateRandomMap();
      public void clearGoalAndStartLocFromWater(int sx, int sy, int gx, int gy) {
        terrain[gx][gy] = 0;
        terrain[sx][sy] = 0;
      private void expandWater() {
        int waterConstant = 40;
        int waterExpansion = 2;
        int[][] moreWater = new int[width][height];
        Random randomizer = new Random();
        for (int t = 0; waterExpansion > t; t++) {
          for (int i = 0; i < width; i++) {
            for (int j = 0; j < height; j++) {
              if (i + 1 >= 0 && j >= 0 && i + 1 < width && j < height) {
                if (terrain[i + 1][j] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i + 1][j] = 1;
              if (i + 1 >= 0 && j - 1 >= 0 && i + 1 < width && j - 1 < height) {
                if (terrain[i + 1][j - 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i + 1][j - 1] = 1;
              if (i >= 0 && j - 1 >= 0 && i < width && j - 1 < height) {
                if (terrain[i][j - 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i][j - 1] = 1;
              if (i - 1 >= 0 && j - 1 >= 0 && i - 1 < width && j - 1 < height) {
                if (terrain[i - 1][j - 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i - 1][j - 1] = 1;
              if (i - 1 >= 0 && j >= 0 && i - 1 < width && j < height) {
                if (terrain[i - 1][j] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i - 1][j] = 1;
              if (i - 1 >= 0 && j + 1 >= 0 && i - 1 < width && j + 1 < height) {
                if (terrain[i - 1][j + 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i - 1][j + 1] = 1;
              if (i >= 0 && j + 1 >= 0 && i < width && j + 1 < height) {
                if (terrain[i][j + 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i][j + 1] = 1;
              if (i + 1 >= 0 && j + 1 >= 0 && i + 1 < width && j + 1 < height) {
                if (terrain[i + 1][j + 1] != 4) {
                  if (randomizer.nextInt(waterConstant) == 0)
                    moreWater[i + 1][j + 1] = 1;
        for (int i = 0; i < width; i++) {
          for (int j = 0; j < height; j++) {
            if (moreWater[i][j] == 1) {
              terrain[i][j] = 4;
      private void generateRandomMap() {
        Random randomizer = new Random();
        for (int i = 0; i < width; i++) {
          for (int j = 0; j < height; j++) {
            if (randomizer.nextInt(3) == 1)
              terrain[i][j] = 0;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 1;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 3;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 2;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 2;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 1;
            else if (randomizer.nextInt(2) == 1)
              terrain[i][j] = 3;
            else
              terrain[i][j] = randomizer.nextInt(5);
        expandWater();
        for (int i = 0; i < width; i++) {
          for (int j = 0; j < height; j++) {
            if (terrain[i][j] != 0)
              landMass++;
      public int getMapHeight() {
        return height;
      public int getMapWidth() {
        return width;
      public int getSquareID(int x, int y) {
        return terrain[x][y];
      public int getSquareMovementCost(int x, int y) {
        return terrainTypes.getMovementCost(terrain[x][y]);
    }PathFinder.java:
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.util.Vector;
    public class PathFinder {
      private BufferedReader consoleReader = new BufferedReader(new InputStreamReader(System.in));
      //The array t3D[][] represents the 2D square map where t3D.leght = map width
      //and t3D[x].lenght = map width (-1 < x < t3D.leght). The third dimension
      //is refered to the square's movement cost, witch is definite by terrain.
      //The fourth dimension will be with lenght = 3. When running the search engine
      //(expanding the explored squares) this 3 values will keep the position of
      //the previous square in 3 dimension, witch are width, height and the maximum
      //movement cost among all squares.
      private int[][][][] squares3DReference;
      //Keeps information witch squares are visited.
      private boolean[][][] visitedSquares;
      private Map map;
      //this is the queue used in the Breathed First Seatch.
      private Vector queue3D;
      //Here is saved the shortest path
      private Vector path2D;
      private int highestMovementCost;
      public PathFinder(Map aMap) {
        map = aMap;
        queue3D = new Vector();
        path2D = new Vector();
        squares3DReference = new int[map.getMapWidth()][map.getMapHeight()][][];
        visitedSquares = new boolean[map.getMapWidth()][map.getMapHeight()][];
        highestMovementCost = map.terrainTypes.getHighestMovementCost();
        buildAbstract3DTerrain();
      private void buildAbstract3DTerrain() {
        for (int x = 0; x < map.getMapWidth(); x++) {
          for (int y = 0; y <map.getMapHeight(); y++) {
            int movementCost = map.terrainTypes.getMovementCost(map.getSquareID(x, y));
            if ( movementCost > 0) {
              visitedSquares[x][y] = new boolean[highestMovementCost];
              squares3DReference[x][y] = new int[highestMovementCost][3];
              for (int z = 0; z < highestMovementCost; z++) {
                for (int t = 0; t < 3; t++) {
                  squares3DReference[x][y][z][t] = -1;
      private boolean isMoveValid(int x, int y, int z, int x2, int y2, int z2) {
        if ( x < 0 || y < 0 || z < 0 || x2 < 0 || y2 < 0 || z2 < 0 || x >= map.getMapWidth() || y >= map.getMapHeight() || z >= highestMovementCost ||  x2 >= map.getMapWidth() || y2 >= map.getMapHeight() || z2 >= highestMovementCost)
          return false;
        if (map.terrainTypes.getMovementCost(map.getSquareID(x2, y2)) < 1)
          return false;
        if (visitedSquares[x2][y2][z2])
          return false;
        if (x == x2 && y == y2)
          return true;
        else {
          if (z == map.terrainTypes.getMovementCost(map.getSquareID(x2, y2)) - 1)
            return true;
          else
            return false;
      private void clearPreviousSearchData() {
        queue3D.clear();
        path2D.clear();
        for (int x = 0; x < map.getMapWidth(); x++) {
          for (int y = 0; y < map.getMapHeight(); y++) {
            if (squares3DReference[x][y] != null) {
              for (int z = 0; z < highestMovementCost; z++) {
                visitedSquares[x][y][z] = false;
                for (int t = 0; t < 3; t++) {
                  squares3DReference[x][y][z][t] = -1;
      private Vector copyPath2D() {
        Vector path = new Vector();
        for (int i = 0; i < path2D.size(); i++) {
          path.add(path2D.get(i));
        return path;
      public Vector findPath(int sX, int sY, int gX, int gY) {
        int head = 0;
        int tail = 0;
        int x = sX;
        int y = sY;
        int z = 0;
        visitedSquares[x][y][z] = true;
        mainLoop: {
          while (tail <= head) {
            int[][] moves = getPosibleMoves(x, y, z);
            for (int i = 0; i < 9; i++) {
              if (moves[i] != null) {
                squares3DReference[moves[0]][moves[i][1]][moves[i][2]][0] = x;
    squares3DReference[moves[i][0]][moves[i][1]][moves[i][2]][1] = y;
    squares3DReference[moves[i][0]][moves[i][1]][moves[i][2]][2] = z;
    queue3D.add(moves[i]);
    if (moves[i][0] == gX && moves[i][1] == gY) {
    break mainLoop;
    visitedSquares[moves[i][0]][moves[i][1]][moves[i][2]] = true;
    head++;
    if (queue3D.size() == 0 || queue3D.size() == tail)
    break mainLoop;
    int[] nextInQueue = ((int[]) queue3D.get(tail));
    x = nextInQueue[0];
    y = nextInQueue[1];
    z = nextInQueue[2];
    tail++;
    if (squares3DReference[gX][gY][0][0] == -1) {
    clearPreviousSearchData();
    return path2D;
    fillpath2D(sX, sY, gX, gY);
    Vector path = copyPath2D();
    clearPreviousSearchData();
    return path;
    private int[][] getPosibleMoves(int x, int y, int z) {
    int[][] moves = new int[9][3];
    if (isMoveValid(x, y, z, x + 1, y, 0)) {
    moves[0][0] = x + 1;
    moves[0][1] = y;
    moves[0][2] = 0;
    else
    moves[0] = null;
    if (isMoveValid(x, y, z, x + 1, y - 1, 0)) {
    moves[1][0] = x + 1;
    moves[1][1] = y - 1;
    moves[1][2] = 0;
    else
    moves[1] = null;
    if (isMoveValid(x, y, z, x, y - 1, 0)) {
    moves[2][0] = x;
    moves[2][1] = y - 1;
    moves[2][2] = 0;
    else
    moves[2] = null;
    if (isMoveValid(x, y, z, x - 1, y - 1, 0)) {
    moves[3][0] = x - 1;
    moves[3][1] = y - 1;
    moves[3][2] = 0;
    else
    moves[3] = null;
    if (isMoveValid(x, y, z, x - 1, y, 0)) {
    moves[4][0] = x - 1;
    moves[4][1] = y;
    moves[4][2] = 0;
    else
    moves[4] = null;
    if (isMoveValid(x, y, z, x - 1, y + 1, 0)) {
    moves[5][0] = x - 1;
    moves[5][1] = y + 1;
    moves[5][2] = 0;
    else
    moves[5] = null;
    if (isMoveValid(x, y, z, x, y + 1, 0)) {
    moves[6][0] = x;
    moves[6][1] = y + 1;
    moves[6][2] = 0;
    else
    moves[6] = null;
    if (isMoveValid(x, y, z, x + 1, y + 1, 0)) {
    moves[7][0] = x + 1;
    moves[7][1] = y + 1;
    moves[7][2] = 0;
    else
    moves[7] = null;
    if (isMoveValid(x, y, z, x, y, z + 1)) {
    moves[8][0] = x;
    moves[8][1] = y;
    moves[8][2] = z + 1;
    else
    moves[8] = null;
    return moves;
    private void fillpath2D(int sX, int sY, int gX, int gY) {
    int[] gLoc = {gX, gY};
    path2D.add(gLoc);
    int x = gX;
    int y = gY;
    int z = 0;
    while (x != sX || y != sY) {
    int x2 = squares3DReference[x][y][z][0];
    int y2 = squares3DReference[x][y][z][1];
    int z2 = squares3DReference[x][y][z][2];
    x = x2;
    y = y2;
    z = z2;
    if (z == 0) {
    int[] loc = {x, y};
    path2D.insertElementAt(loc, 0);
    PathFinderTest.java
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.util.Vector;
    public class PathFinderTest {
      static BufferedReader consoleReader = new BufferedReader(new InputStreamReader(System.in));
      static Map map;
      static int startX;
      static int startY;
      static int goalX;
      static int goalY;
      public static void main(String[] args) throws Exception {
        System.out.print("Enter map size.\nx = ");
        int width = Integer.parseInt(consoleReader.readLine());
        System.out.print("y = ");
        int height = Integer.parseInt(consoleReader.readLine());
        System.out.print("Enter strting location.\nx = ");
        startX = Integer.parseInt(consoleReader.readLine()) - 1;
        System.out.print("y = ");
        startY = Integer.parseInt(consoleReader.readLine()) - 1;
        System.out.print("Enter goal location.\nx = ");
        goalX = Integer.parseInt(consoleReader.readLine()) - 1;
        System.out.print("y = ");
        goalY = Integer.parseInt(consoleReader.readLine()) - 1;
        if (goalX < 0 || goalY < 0 || startX < 0 || startY < 0 || goalX >= width || goalY >= height || startX >= width || startY >= height) {
          System.out.println("Invalid parameters found. Program will exit");
          System.exit(0);
        map = new Map(width, height);
        map.clearGoalAndStartLocFromWater(startX, startY, goalX, goalY);
        printSolution(new Vector());
        PathFinder pathFinder = new PathFinder(map);
        long before = System.currentTimeMillis();
        Vector path = pathFinder.findPath(startX, startY, goalX, goalY);
        long after = System.currentTimeMillis();
        long time = after - before;
        printSolution(path);
        if (path.size() == 0)
          System.out.println("No path found.");
        else
          System.out.println("Path found.");
        System.out.println("Finding the path took " + time + " milliseconds");
      static void printSolution(Vector path) {
        boolean[][] pathOnMap = new boolean[map.getMapWidth()][map.getMapHeight()];
        for (int i = 0; path.size() > i; i++) {
          int[] move = (int[]) path.get(i);
          pathOnMap[move[0]][move[1]] = true;
        for (int y = 0; y < map.getMapHeight(); y++) {
          for (int x = 0; x < map.getMapWidth(); x++) {
            System.out.print(" ");
            if (pathOnMap[x][y] == false)
              System.out.print(" ");
            else
              System.out.print("0");
            if (x == startX && y == startY)
              System.out.print("S");
            else if (x == goalX && y == goalY)
              System.out.print("G");
            else
              System.out.print(map.terrainTypes.getNameFirstLetter(map.getSquareID(x, y)));
          System.out.println();
        System.out.println();
    }TerrainType.java:
    public class TerrainType {
      private int movementCost;
      private String name;
      TerrainType(int aMovementCost, String aName) {
        movementCost = aMovementCost;
        name = aName;
      public int getMovementCost() {
        return movementCost;
      public String getName() {
        return name;
      public String getNameFirstLetter() {
        return name.substring(0, 1).toUpperCase();
    }TerrainTypes.java:
    import java.util.Vector;
    public class TerrainTypes {
      //Here are saved the terrain types with the map has. ElementAt 'i' in
      //setOfTypes is represented by the number in Map.terrain[x][y] witch is
      //equal to i, were x, y are random integer as soon as they do not
      //throw ArrayIndexOutOfBoundsException. Actually this is a coding to know
      //a specific square in the map to witch terrain type is refered in setOfTypes.
      private Vector setOfTypes;
      public TerrainTypes() {
        setOfTypes = new Vector();
        setOfTypes.add(new TerrainType(1, "Plains"));
        setOfTypes.add(new TerrainType(2, "Forst"));
        setOfTypes.add(new TerrainType(3, "Jungle"));
        setOfTypes.add(new TerrainType(4, "Mountain"));
        setOfTypes.add(new TerrainType(-1, "X"));
      public int getMovementCost(int i) {
        return ((TerrainType) setOfTypes.get(i)).getMovementCost();
      public String getName(int i) {
        return ((TerrainType) setOfTypes.get(i)).getName();
      public String getNameFirstLetter(int i) {
        return ((TerrainType) setOfTypes.get(i)).getNameFirstLetter();
      public int getHighestMovementCost() {
        int max = 1;
        for (int i = 0; setOfTypes.size() > i; i++) {
          int movementCost = ((TerrainType) setOfTypes.get(i)).getMovementCost();
          if ( movementCost > 0) {
            if (max < movementCost)
              max = movementCost;
        return max;
    }I hope this program will be helpful.
    Sogartar

    Why is such a smart guy like you not using A*
    It is a general known algorithm which will find the
    optimal solution in a finite search-space (within a minimal time).
    The calculation time for the A* algorithm is influenced by two parameters:
    1 - cumulative cost
    2 - minimal expected additional cost
    The calculation of these two costs has a great influence on the
    solution.
    I think the actual problems most games experience with shortest path calculatoin are
    1 - very little time to spent calculating the shortest path
    The quickest solution might be the best for the game
    If your solution takes 1 second for the calculation of a path for one element on the board (100x100)
    What would it take for the game to calculate the path for all elements controlled by the computer ??
    If the computer controls two players which each have 50 elements to control, it would take forever...
    Don't even consider the usage of a larger board (200x200 would take 4 seconds/element when
    algorithm has complexity O(n))
    2 - low priority.
    Users tend to forgive a bad shortest path-algorithm most of the time,
    but not a bad display, bad pictures,...
    This is why most shortest-path algorithms within games were
    developed as a depth first search,
    within some earlier games this was even developed as
    a rule which went straight to the endlocation and
    takes a right/left turn when blocked by water/wall/...
    So the actual steps you should take are:
    1 - develop a normal breath-first search (to get going)
    2 - develop a normal depth-first search (to compare speed and solution with)
    3 - develop a normal dijkstra algorithm (sometimes called A)
    4 - develop a best first algorithm (called A*)
    5 - develop other AI-algorithms building upon A* (tabu-search, limited memory A*,...)
    6 - develop some other AI-algorithms (Genetic Algorithms, Simulated Annealing,...)
    7 - compare and tweak/change all search-algorithms for
    7 - a - size of maps (small versus huge)
    7 - b - optimality of the solution
    7 - c - actual usage for your game
    8 - !!! very important !!!
    Share the developed path algorithms along with remarks about speed, map-size,...
    with the rest of us. I would be very interested in such library.
    kind regards,

  • 2 SDO_GEOM columns with different coord systems

    Hi
    I have an intersection (traffic lights, etc.) that when shown on the map is a point and its position is stored as Lat/Long. However, when I zoom in on this intersection I need to be able to bring up a schematic (detailed plan) which will be in some cartesian coords.
    My thought is to store the schematic data as a geometry collection in the same table as the rest of the data.
    Is this possible?
    And, are there any traps I should be looking for?

    You are free to mix geometries with different coordinate systems in a table, as long as all the geometries in a given column of the table have the same coordinate system. This should support what you are trying to do with expanded levels of detail in your point features.

  • ALV Table: DROPDOWN-Column with different valuesets per row

    Hello,
    I tried to create a dropdown by index cell in a table with different valuesets in each row. So I created an attribute VALUESET of type WDR_CONTEXT_ATTR_VALUE_LIST in my node to provide different valuesets per element. In my ALV-table I bound the property "valueset_fieldname" of the dropdown-cell to the context-attribute VALUESET:
      lo_column = lo_alv_model>if_salv_wd_column_settings~get_column( id = 'PRICE').
      CREATE OBJECT lo_drop_down_idx
        EXPORTING
          selected_key_fieldname = u2018PRICEu2019.
      lo_drop_down_idx->set_valueset_fieldname( value = u2018VALUESETu2019 ).
      lo_column->set_cell_editor( lo_drop_down_idx ).
    Now I have the problem, that the list of the dropdown-cell displays the proper amount of values but not the proper texts . My valueset looks for example like this:
    Value: A
    Text:  A
    Value: B
    Text:  B
    Value: C
    Text:  C
    Value: D
    Text:  D
    But my Dropdown-cell shows these values:
    A
    A
    A
    D
    Could you please help?
    Edited by: Developer on Feb 2, 2010 5:32 PM

    Hello Lekha,
    thank you for your answer. I think there might be an other reason for this problem. When I debug the view with the Webdynpro-Debugger the valueset in the context contains the correct values but the dropdown shows wrong values.
    You also sent me a link with a codesample. In this coding you use the following statement:
    lr_drp_idx->set_texts( 'VALUESET'   ). This is a method of the class CL_WD_DROPDOWN_BY_IDX. I used the class cl_salv_wd_uie_dropdown_by_idx as I'm working with an ALV-Table. This class doesn't have the method set_texts. Instead it has a method called 'set_valueset_fieldname'. Maybe this method has a bug?
    Regards,

  • Find duplicate values in a table based on combination of two columns.

    In table which have millions of records -
    I have a Table B under Schema A and i have to find the duplicate records in a table. My Table B uses the combination of columns to identify the unique values.
    Scenario is something like this-
    One SV_Id can have multiple SV_Details_Id and i have to find out if there is any duplicate in the table. (I have to use combination of columns to identify the unique values and there is no Primary Key, Foreign Key or Unique Key on the table)
    then wrote the following query -
    select SV_Id,SV_Details_Id count (*) from SchemaA.TableB group by SV_Id,SV_Details_Id having Count (*) > 1 ;
    Is it correct as after firing the above query it is returning the rows which is not matching to the duplicate.
    kindly help me.
    Looking forward for some guidance -
    Thanks in advance.

    What is the desired output??
    Do you want to see only unique records??
    Or you want to see the duplicate records.
    Giving an example will make it easier to provide the required querty.
    BTW here is an simple query which is used to delete the duplicate records and keep the unique records in table.
    DELETE
      FROM table_name     a
    WHERE EXISTS (SELECT 1
                     FROM table_name      b
                    WHERE a.sv_id         = b.sv_id
                      AND a.sv_detail_id  = b.sv_detail_id
                      AND a.ROWID         > b.ROWID
                   );Regards
    Arun

  • Return only the columns with different values.

    Hi all,
    I am trying to solve a seemingly trivial problem but can't seem to get any straight answer anywhere in any forum. Consider a single table with 5 columns and only two rows:
    row_id           first_name         last_name        age            gender
    1                    John                  doe               27             M
    1                    Jane                  doe               27              F  Assume there is no primary key or any other constraint. Also assume that there are only and only two rows in this table. So I basically need a query that, in the above set of rows, would return first_name and gender, as they are the only differing columns in the two rows, and also their values. Even if i can somehow get the column names that are differing that would be enough as I can easily access the values later on. Also it is important to remember that I may not know the column names of all the columns, so basically I somehow must utilize user_tab_columns in the process.
    Any help appreciated.
    Edited by: 894302 on May 1, 2013 10:35 AM

    Hi,
    894302 wrote:
    There is nothing wrong with it. Here you have added all the columns in the decode statement as you already know all the column names. What if there is a table whose column names are unknown i.e I can pass the table as a parameter to a procedure and I would need to loop through all the columns and then perform this operation.Table- and column names must be hard-coded into the query. If you want to figure out what the columns are at run time, given only hte table name, then you need dynamic SQL.
    All the column names are in the data dictionary view all_tab_columns. You can easily loop through them to build exactly as many lines like
    DECODE (a.row_id,     b.row_id,     NULL, 'row_id,')     ||as you need in the SELECT clause. The FROM clause is dynamic, too: it has the variable table name in 2 places.
    But i am not sure if it worth the effort to do it on the database side. Probably easier to do it on the middle tier such as .NET, which where the business logic is implemented in my company.I don't know much about .NET, so I can't compare them
    It's not very hard to do in PL/SQL (as dynamic SQL goes).
    Edited by: Frank Kulash on May 1, 2013 4:39 PM
    Here's a function that does the dynamic SQL:
    CREATE OR REPLACE FUNCTION  different_columns
    (  in_table_name  IN  VARCHAR2
    ,  in_owner_name  IN  VARCHAR2     DEFAULT USER
    RETURN VARCHAR2
    IS
        return_str     VARCHAR2 (4000);
        sql_str     VARCHAR2 (1000);
    BEGIN
        sql_str := 'SELECT  RTRIM ( ';
        FOR  c  IN ( SELECT    column_name
                          ,        ROW_NUMBER () OVER (ORDER BY  column_id  DESC)  AS r_n
                          FROM        all_tab_columns
               WHERE        owner     = in_owner_name
               AND        table_name     = in_table_name
               ORDER BY  column_id
        LOOP
            sql_str := sql_str || '                DECODE (a.'
                         || c.column_name
                      || ', b.'
                      || c.column_name
                      || ', NULL, '''
                      || c.column_name
                      || ', '')';
         IF  c.r_n > 1
         THEN
             sql_str := sql_str || ' ||';
         END IF;
         sql_str := sql_str || CHR (10);
        END LOOP;
        sql_str := sql_str || '              , '', '''     || CHR (10)
                                || '              )'          || CHR (10)
                     || 'FROM  "' || in_owner_name
                     || '"."' || in_table_name
                     || '" a'                    || CHR (10)
                     || 'JOIN  "' || in_owner_name
                     || '"."' || in_table_name
                     || '" b ON a.ROWID < b.ROWID';
        -- dbms_output.put_line (sql_str);     -- for debugging
        EXECUTE IMMEDIATE   sql_str  INTO  return_str;
        RETURN  return_str;
    END  different_columns;
    SHOW ERRORSYou can call it in SQL like this:
    SELECT     different_columns ('RHIT_TABLE_X')  AS dc
    FROM     dual
    ;Using PL/SQL, we might not need RTRIM, at least not in the query. I'll leave that as an exercise.

  • Displaying one field over 5 different columns with different criteria

    Post Author: new_crystal
    CA Forum: Crystal Reports
    I am new to Crystal and need some help urgently..
    I saw you answering almost each n every question on Crystal asked in the forum...thats why sending you my question in a message...I have also posted it on the forum
    Here is what I want:
    I am creating a report which has a xml data source.
    I have a field named fieldvalue in the xml, I need to present this fieldvalue in a column format based on the name of the column heading which is another field in the database called fielddata
    here is what i want
    fielddata1     fielddata2    fielddata3 .......
    fieldvalue1    fieldvalue2   fieldvalue3......
    i have dragged the fieldvalue 3 times in the report and applied different formula for each one of them
    here is the eg. of the formula
    if ( = "A" ) then
    but it is not giving me the correct values pulled from the data source. for the first column it is pulling correctly but for the rest of the columns it is giving values as 0's.
    Thanks in Advance

    Post Author: pvierheilig
    CA Forum: Crystal Reports
    Hello -
    Can't you set the group to be on the category?  Selecting the product name in the record selection formula will present only those product (as opposed to categories).
    A subreport, as suggested, will work as well, but your stated record selection will continue to produce the same results - check that, too.  Additionally, you could group on the category and add a group 'b' section (Section Expert; see the Help file).

  • Problem about mapping 1 column with different tables..

    Hi,
    I have 3 Tables (I will give examples not exact tables but same structure and logic)
    Cars :
       ID  ( Car ID)
       Name
    Planes :
       ID ( Plane ID)
       Name
    Processes :
       ID ( Process ID )
       Type
       VehicleID {code}*Sample Processes Table Data*
    {code:java}ID     Type      VehicleID
    1          1               1       
    2          1               2
    3          2               1
    3          2               2{code}
    When type is *1*, This is *Car* and means that *VehicleID* maps to *Cars Table*,
    When type is *2*, This is *Plane* and means that *VehicleID* maps to *Planes Table*.
    And So On 3, 4, 5, 6 .. for Additional tables.
    How can i map something like that? I can not merge these tables, they all must be separated..
    I used to handle this by writing native SQL with some functions, however with JPA i could not figure it out..
    Thanks again
    Regards.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I do not know an easy way to do this in pure JPA. EclipseLink though is able to do this using a variable one to one mapping:
    http://wiki.eclipse.org/Introduction_to_Relational_Mappings_%28ELUG%29#Variable_One-to-One_Mapping
    This can be set using a customizer or JPA like annotations:
    @VariableOneToOne(
    targetInterface=Vehicle.class,
    cascade=PERSIST,
    fetch=LAZY,
    discriminatorColumn=@DiscriminatorColumn(name="TYPE", discriminatorType=INTEGER),
    discriminatorClasses={
    @DiscriminatorClass(discriminator="1", value=Cars.class),
    @DiscriminatorClass(discriminator="2", value=Planes.class)
    Best Regards,
    Chris

  • Want to update a column with  different column of same table

    I have a table TEST_CDR which is having 250 millions records also having partition by hash.
    there are two column in this table ID and CDR_ID want to update ID in CDR_ID but it take too much time like 24 hours or more.
    please suggest me a simple way.

    Hi,
    You can try this. but be careful about your backups and go through CTAS,nologging and parallel concepts...
    Please refer this link.
    http://www.dba-oracle.com/t_fast_batch_updates_ctas.htm
    http://www.dba-oracle.com/t_nologging_append.htm
    http://www.dba-oracle.com/t_efficient_update_sql_dml_tips.htm
    http://eriglen.blogspot.in/2011/08/ctas-create-table-as-select-with.html
    1.CTAS with nologging and parallel..
    SQL> create table test_cdr_1(id,cdr_id) nologging parallel as select id,id from test_cdr;
    2.rebuild indexes, triggers and constraints to test_cdr_1
    3.rename test_cdr to bkup_test_cdr;
    4.rename test_cdr_1 to test_cdr;
    Regards,
    ragunath.

Maybe you are looking for

  • Calling a web service from a servlet via stub: java.lang.reflect.Invocation

    Hi all, I'm developping my first web application using Apache Tomcat and Axis, using servlets, jsp and web services. My problem is that I cannot make any call to my web service (a very simple one) because I get the following exception: <code> java.la

  • Unable to start print job. Is printer availble? CS3 loaded on Windows 7 64bit

    Hello to everyone: I have a network of PC's. As part of their basic install I load on CS3. I have started to incorporate Windows 7 and found the following problem on all of them but not on any of the XP's. When my users try to print from Acrobat 8 th

  • Essbase Error in Excel's Add-In

    When i drill-down in a Cube's Dimension in a vast query (using the Essbase's add-in for Excel), i get the Essbase Error: Maximum number of rows [8192] exceeded [8208]. Although i increased the No of rows in parameter SSPROCROWLIMIT in essbase.cfg, th

  • Flash CS5 crashes when importing an image sequence

    I am trying to compile an image sequence rendered from modeling software (550 frames). The images are approx. 120kb in size. So far I have only been able to import about 100 images at a time, but when I get to the third import flash crashes. I have a

  • Siri and messages with attachments

    Does anybody know if it is possible to send messages (SMS or emails) containing attachments with SIRI? I have tried to open the Photos application and say something like "Send this photo to xxx". Siri effectively recognizes my contact name but asks m