Some SQL Help for a Complete Beginner

...........

Use ROLLUP then
SQL> select id,
  2         case when grouping(id)=1 and grouping(pro_name)=1 then 'Total' else pro_name end pro_name
  3         sum(quantity) quantity
  4    from product
  5   group by rollup(id, pro_name)
  6  having (grouping(id)=0 and grouping(pro_name)=0)
  7      or (grouping(id)=1 and grouping(pro_name)=1)
  8  /
ID    PRO_NAME               QUANTITY
11011 Socket Type 3                20
11110 Wrench Type 2                44
11111 Bolt Type 1                  40
22022 Hammer                       30
22220 Wrench Type 3                44
22222 Bolt Type 2                  40
33330 Wrench Type 4                44
33333 Bolt Type 3                  40
44440 Nut Type 1                   80
44444 Bolt Type 4                  40
55550 Nut Type 2                   80
55555 Nail Type 1                 400
66660 Nut Type 3                   80
66666 Nail Type 2                 400
77770 Nut Type 4                   80
77777 Nail Type 3                 400
88880 Socket Type 1                20
88888 Nail Type 4                 400
99990 Socket Type 2                20
99999 Wrench Type 1                44
      Total                      2346
21 rows selected.Your price field is CHAR data type. You cant use it with quantity field which is a NUMBER data type.
The basic structure of your table is wrong you need to modify it.
Edited by: Karthick_Arp on May 8, 2009 11:47 PM

Similar Messages

  • Help for a complete beginner!

    Hello,
    I want to apologize in advance for how little I know on this topic, and about programming together. I am not asking for myself, but to give some advice to a young family member of mine. He works with a company that uses a ColdFusion website, and we were speaking the other day about how the company is looking to eventually hire a new ColdFusion programmer.
    Here is the problem for my nephew: he doesn't have any programming experience. He is very computer savvy for a young guy, and he is very interested in going after this, but he told me he doesn't know where to begin. I took the obvious course and said "aren't there such things as ColdFusion classes?" but he seems to think it is not so simple as that - like you can't just jump in as a total beginner into working with ColdFusion?
    So I thought I would do a little research. If you were just starting out, and were looking to eventually develop and program a coldfusion website, how would you start? What steps would you take (the more detailed the better)? Someone told me "he should start out by learning HTML", but if you could even break that down more - how would you go about learning HTML? If you have any more questions for me about my nephew, i'd be happy to answer them.
    Thanks!

    Learning HTML would be a good start in contextualising how web pages work, and therefore what ColdFusion code will be needing to do.
    FInding HTML tutorials is easy: just google "introduction to HTML" or "HTML tutorial" or something.  If you prefer printed books, there'll be a bunch of those available too (search Amazon).  I do not know which books are considered good or bad in this context, but the user comments and votes should be a good indication.
    As for learning ColdFusion, just leaping into a course might not be the best bet for your newphew.  Way back when I did the ColdFusion Fasttrack course without ever having used (or seen) CFML before, and found it easy, but I did have a background of doing the odd bit of programming, so I was at least familiar with basic principles.  If he doesn't have any pre-existing programming knowledge, it might not be the best way to start.
    The only printed CF book of note (that I'm aware of) is the CFWACK.  I've not looked at one for years, and cannot remember whether it's intended as a learning tool, or just as a reference.  Someone else can perhaps comment on that.
    There are a bunch of matches for "coldfusion tutorials" on Google, of varying age and quality: they're probably worth looking at though.
    If I was learning a new language, I'd just use online tutorials.  If I was going to be learning programming, though, I'd go do a general programming course (like at the local polytech or college or whatever) first.  The principles behind programming are more important than the language, IMO.
    Of course if he dives into CF and has questions to ask, he can always ask them here.
    Adam

  • Which book is best for learning Lightroom 5 for a complete beginner?

    I'm an Aperture user and as everyone has heard the news, a lot of us are considering switching over. I went through the Apple pro-training aperture, logic, and FCP books and loved the format of those. I've been reviewing my options for LR5 books on Amazon and I see a couple, Kelby, Evening, and The Adobe Classroom in a book. I kind of like the classroom in a book format as it resembles the Apple book's format. Which book is best for learning LR5, from a complete beginner's perspective?

    I would avoid Kelby like the plague. I didn't like his book, I felt his chapters on the Library module were effectively useless and off the mark.
    I would start with the free e-book Lightroom 5 - Free Quick Start Guide PDF eBook | The Lightroom Queen
    I would also watch some videos at Products | Lightroom | Adobe TV

  • Help for a baffled beginner

    Ive just installed Oracle Express to help me go through a phase test. Ive created 3 tables under the SYSTEM username that I started the database with. Ive populated the tables with some data
    Now whenever I try and enter any SELECT command it tells me      
    ORA-00942: table or view does not exist
    Now a quick look on google tells me this is most likley that I don't have permission...however, I can't see what I can do to change that, I am the only user. If I create a new admin and recreate the tables it tells me the same.
    Also, infuriatingly, it tells me that the 'show tables' is not a valid SQL command so I cannot make sure I am typing it correctly. Although obviously I have gone back into the object browser to check countless times.
    Please help me out! Im assuming its something small, but google is huge and I don't even know where to begin with this.
    Thanks
    Mike

    Im not using the command prompt, oracle express 10g's menu to create everything.
    However the sql for the existing tables is
    CREATE TABLE " Employee"
    (     "id" NUMBER NOT NULL ENABLE,
         "name" CHAR(100) NOT NULL ENABLE,
         CONSTRAINT " Employee_PK" PRIMARY KEY ("id") ENABLE
    CREATE TABLE "Car"
    (     "regNo" VARCHAR2(10) NOT NULL ENABLE,
         "distanceInKm" NUMBER NOT NULL ENABLE,
         "kmPerLiter" NUMBER NOT NULL ENABLE,
         CONSTRAINT "Car_PK" PRIMARY KEY ("regNo") ENABLE
    These are for the 2 tables I have managed to create under Mike.
    There is a 3rd with 2 foreign keys referencing the above tables and for some reaso, even tho it was possible before under SYSTEM, yet do not exist under Mike, I cannot recreate it
    When I log back in under system, the above two tables are still there (as I created them earlier) and also the one I mention above that I did successfully create under system
    CREATE TABLE "TravelCost"
    (     "journeyId" CHAR(10) NOT NULL ENABLE,
         "carRegNo" CHAR(10) NOT NULL ENABLE,
         "employeeId" CHAR(10) NOT NULL ENABLE,
         "occurred" DATE NOT NULL ENABLE,
         "distanceInKm" NUMBER NOT NULL ENABLE,
         CONSTRAINT "TravelCost_PK" PRIMARY KEY ("journeyId") ENABLE,
         CONSTRAINT "TRAVELCOST_FK" FOREIGN KEY ("carRegNo")
         REFERENCES "CAR" ("REGNO") ENABLE,
         CONSTRAINT "TRAVELCOST_FK2" FOREIGN KEY ("employeeId")
         REFERENCES "EMPLOYEE" ("ID") ENABLE
    But I constantly get the 'table doesnt exist'.
    Apologies for my wirting, Im in rush and I have a new wireless keyboard thats abysmal
    Edited by: user8946571 on Jan 4, 2010 10:58 AM
    Edited by: user8946571 on Jan 4, 2010 11:00 AM

  • Complex SQL help for a

    I do not know if this is the right place for thius type of post. If it is not please advise where the right place is.
    I need help generating a report, hopefully with SQL in 8.1.7
    SQL Statement which produced the data below the query :
    SELECT CHANGE.change_number, CHANGE.route_date as DATE_TO_CCB, nodetable.description AS Approver_required, (TRIM(BOTH ',' FROM CHANGE.PRODUCT_LINES)) AS PRODUCT_LINES /*, PROPERTYTABLE.VALUE as PRODUCT_LINES */
    FROM CHANGE, signoff, workflow_process, nodetable /*, PROPERTYTABLE */
    WHERE ( (CHANGE.ID = signoff.change_id)
    AND (CHANGE.process_id = signoff.process_id)
    AND ((nodetable.id = signoff.user_assigned) or (nodetable.id=signoff.user_signed))
    AND (CHANGE.process_id = workflow_process.ID)
    AND (CHANGE.ID = workflow_process.change_id)
    AND (CHANGE.workflow_id = workflow_process.workflow_id)
    AND (SIGNOFF.SIGNOFF_STATUS=0 )/* in (0, 2, 3)) */ /* 0=request needs attention, 2=request approved, 3=request rejected */
    AND (SIGNOFF.REQUIRED=5 or SIGNOFF.REQUIRED=1) /* 1=Approver 5= Ad Hoc Approver */
    AND (CHANGE.IN_REVIEW=1)
    AND (CHANGE.RELEASE_DATE IS NULL)
    AND (CHANGE.CLASS != '4928')
    /* AND (PROPERTYTABLE.PROPERTYID IN (SELECT TRIM(BOTH ',' FROM CHANGE.PRODUCT_LINES) FROM CHANGE)) */
    order by change.route_date desc
    **** Results **********
    CHANGE_NUMBER|DATE_TO_CCB|APPROVER_REQUIRED|PRODUCT_LINES
    C02190|11/14/2008 3:34:02 PM|Anurag Upadhyay|270354,270362|
    C02190|11/14/2008 3:34:02 PM|Dennis McGuire|270354,270362|
    C02190|11/14/2008 3:34:02 PM|Hamid Khazaei|270354,270362|
    C02190|11/14/2008 3:34:02 PM|Mandy York|270354,270362|
    C02193|11/14/2008 3:05:18 PM|Hamid Khazaei|274279,266339,266340,266341|
    C02193|11/14/2008 3:05:18 PM|Rob Brogle|274279,266339,266340,266341|
    C02193|11/14/2008 3:05:18 PM|Xavier Otazo|274279,266339,266340,266341|
    C02193|11/14/2008 3:05:18 PM|san|274279,266339,266340,266341|
    C02194|11/14/2008 2:51:34 PM|Diana Young|271503|
    C02194|11/14/2008 2:51:34 PM|Carl Krentz|271503|
    C02194|11/14/2008 2:51:34 PM|Dennis Yen|271503|
    C02194|11/14/2008 2:51:34 PM|Gordon Ries|271503|
    C02194|11/14/2008 2:51:34 PM|Sunil Khatana|271503|
    M00532|11/13/2008 1:34:42 PM|Dennis Yen|270356,270354,270360,274279,266339,266340,266341,276780,260784|
    M00532|11/13/2008 1:34:42 PM|Jin Hong|270356,270354,270360,274279,266339,266340,266341,276780,260784|
    M00532|11/13/2008 1:34:42 PM|Sunil Khatana|270356,270354,270360,274279,266339,266340,266341,276780,260784|
    Each value in the numeric comma delimited string has a corresponding ID for the actual test string value in another table as shown below.
    PROPERTYID|VALUE
    260775|product 1
    260776|Product 2
    260777|Product x
    260778|Product y
    260779|Internal
    260780|ORCA
    260781|Tiger
    260782|Orange product
    260783|Restricted
    260784|Product zz
    266259|Product YYY
    266260|Hercules
    266261|Tangerine
    *****Desired output****
    CHANGE_NUMBER|DATE_TO_CCB|APPROVER_REQUIRED|PRODUCT_LINES
    C02190|Nov/14/2008 03:34:02 PM|Anurag Upadhyay, Dennis McGuire, Hamid Khazaei, Mandy York|Product Y,Product 1
    C02193|Nov/14/2008 03:05:18 PM|Hamid Khazaei, Rob Brogle, Xavier Otazo, san|Hercules,Apple,Product 3,Product zz
    C02194|Nov/14/2008 02:51:34 PM|Diana Young, Carl Krentz, Dennis Yen, Gordon Ries, Sunil Khatana|Product 2
    M00532|Nov/13/2008 01:34:42 PM|Dennis Yen, Jin Hong, Sunil Khatana|Product 1,Product 4,product yy,product YYY,ORCA,Tiger,Orange product,Restricted

    Hi,
    Here's how you can do it in Oracle 8.1.
    To get the individual sub-strings from product_lines, join your current result set to this "counter table"
    (   SELECT  ROWNUM  AS n
        FROM    all_objects
        WHERE   ROWNUM <= 10 -- upper bound on number of items
    )  cntrIf you don't know the worst case of how many items might be in product_lines, it's a little more complicated:
    (   SELECT  ROWNUM  AS n
        FROM    all_objects
        WHERE   ROWNUM <= 1 +
                SELECT  MAX ( LENGTH (product_lines)
                            - LENGTH (REPLACE (product_lines, ','))
                FROM    table_name
    )  cntrJoin this to the existing result set like this
    WHERE   ...
    AND     INSTR ( product_lines || ','    -- one extra comma added
                  , 1
                  , n
                  ) > 0When you do the join, you will have
    one copy of all the rows with one item in producgt_lines,
    two copies of all the rows with two items in producgt_lines,
    three copies of all the rows with three items in producgt_lines,
    and so on.
    When a row has been copied, each copy will have a different value of cntr.n.
    To extract the n-th substring from product_lines:
    SELECT  ...
            SUBSTR ( product_lines
                   , INSTR ( ',' || product_lines,   ',',   1,   n)
                   , ( INSTR (product_lines || ',',   ',',   1,   n)
                     - INSTR (',' || product_lines,   ',',   1,   n)
                   )  AS product_lines_itemWhen you have derived this column, you can join to the table with the translations
    WHERE  TO_NUMBER (product_lines_item) = propertyidTo combine these rows into one row with a comma-delimited list, GROUP BY all the columns you want to select except the property_value ('produc 1', 'tangerine', etv.), and SELECT:
    LTRIM ( MAX (CASE WHEN n =  1 THEN ',' || property_value END) ||
            MAX (CASE WHEN n =  2 THEN ',' || property_value END) ||
            MAX (CASE WHEN n = 10 THEN ',' || property_value END)
          )I don't know a good way to re-combine the rows in Oracle 8 without assuming some limit on the number of items. I assumed there would never be more than 10 in the example above. You can say 20 or 100, I suppose, if you want to. If you guess too high, everything will still work: the query will just be slower.
    This is a just one example of why packing several values into a single column is a bad idea.

  • Drawing and some layout help for a simple control: thin lines and application start

    I am trying to create a new, simple control. The control should act as a grouping marker much like that found in the Mathematica notebook interface. It is designed to sit to the right of a node and draw a simple bracket. The look of the bracket changes depending on whether the node is logically marked open or closed.
    After looking at some blogs and searching, I tried setting the snapToPixels to true in the container holding the marker control as well as the strokewidth but I am still finding that the bracket line is too thick. I am trying to draw a thin line. Also, I am unable to get the layout to work when the test application is first opened. One of the outer brackets is cut-off. I hardcoded some numbers into the skin just to get something to work.
    Is there a better way to implement this control?
    How can I get the fine line drawn as well as the layout correct at application start?
    package org.notebook;
    import javafx.beans.property.BooleanProperty;
    import javafx.beans.property.IntegerProperty;
    import javafx.beans.property.SimpleBooleanProperty;
    import javafx.beans.property.SimpleIntegerProperty;
    import javafx.scene.control.Control;
    * Provide a simple and thin bracket that changes
    * it appearance based on whether its closed or open.
    public class GroupingMarker extends Control {
      private final static String DEFAULT_STYLE_CLASS = "grouping-marker";
      private BooleanProperty open;
      private IntegerProperty depth;
      public BooleanProperty openProperty() { return open; }
      public IntegerProperty depthProperty() { return depth; }
      public GroupingMarker(boolean open) {
      this();
      setOpen(open);
      public GroupingMarker() {
      open = new SimpleBooleanProperty(true);
      depth = new SimpleIntegerProperty(0);
      getStyleClass().add(DEFAULT_STYLE_CLASS);
      // TODO: Change to use CSS directly
      setSkin(new GroupingMarkerSkin(this));
      public boolean isOpen() {
      return open.get();
      public void setOpen(boolean flag) {
      open.set(flag);
      public int getDepth() {
      return depth.get();
      public void setDepth(int depth) {
      this.depth.set(depth);
    package org.notebook;
    import javafx.scene.Group;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.FillRule;
    import javafx.scene.shape.LineTo;
    import javafx.scene.shape.MoveTo;
    import javafx.scene.shape.Path;
    import com.sun.javafx.scene.control.skin.SkinBase;
    * The skin draws some simple lines on the right hand side of
    * the control. The lines reflect whether the control is considered
    * open or closed. Since there is no content, there is no
    * content handling code needed.
    public class GroupingMarkerSkin extends SkinBase<GroupingMarker, GroupingMarkerBehavior> {
      GroupingMarker control;
      Color lineColor;
      double shelfLength;
      double thickness;
      private Group lines;
      public GroupingMarkerSkin(GroupingMarker control) {
      super(control, new GroupingMarkerBehavior(control));
      this.control = control;
      lineColor = Color.BLUE;
      shelfLength = 5.0;
      thickness = 1.0;
      init();
      * Attached listeners to the properties in the control.
      protected void init() {
      registerChangeListener(control.openProperty(), "OPEN");
      registerChangeListener(control.depthProperty(), "DEPTH");
      lines = new Group();
      repaint();
      @Override
      protected void handleControlPropertyChanged(String arg0) {
      super.handleControlPropertyChanged(arg0);
        @Override public final GroupingMarker getSkinnable() {
            return control;
        @Override public final void dispose() {
        super.dispose();
            control = null;
        @Override
        protected double computePrefHeight(double arg0) {
        System.out.println("ph: " + arg0);
        return super.computePrefHeight(arg0);
        @Override
        protected double computePrefWidth(double arg0) {
        System.out.println("pw: " + arg0);
        return super.computePrefWidth(40.0);
         * Call this if a property changes that affects the visible
         * control.
        public void repaint() {
        requestLayout();
        @Override
        protected void layoutChildren() {
        if(control.getScene() != null) {
        drawLines();
        getChildren().setAll(lines);
        super.layoutChildren();
        protected void drawLines() {
        lines.getChildren().clear();
        System.out.println("bounds local: " + control.getBoundsInLocal());
        System.out.println("bounds parent: " + control.getBoundsInParent());
        System.out.println("bounds layout: " + control.getLayoutBounds());
        System.out.println("pref wxh: " + control.getPrefWidth() + "x" + control.getPrefHeight());
        double width = Math.max(0, 20.0 - 2 * 2.0);
        double height = control.getPrefHeight() - 4.0;
        height = Math.max(0, control.getBoundsInLocal().getHeight()-4.0);
        System.out.println("w: " + width + ", h: " + height);
        double margin = 4.0;
        final Path VERTICAL = new Path();
        VERTICAL.setFillRule(FillRule.EVEN_ODD);
        VERTICAL.getElements().add(new MoveTo(margin, margin)); // start
        VERTICAL.getElements().add(new LineTo(margin + shelfLength, margin)); // top horz line
        VERTICAL.getElements().add(new LineTo(margin + shelfLength, height - margin)); // vert line
        if(control.isOpen()) {
        VERTICAL.getElements().add(new LineTo(margin, height - margin)); // bottom horz line
        } else {
        VERTICAL.getElements().add(new LineTo(margin, height-margin-4.0));
        //VERTICAL.getElements().add(new ClosePath());
        VERTICAL.setStrokeWidth(thickness);
        VERTICAL.setStroke(lineColor);
        lines.getChildren().addAll(VERTICAL);
        lines.setCache(true);
    package org.notebook;
    import com.sun.javafx.scene.control.behavior.BehaviorBase;
    public class GroupingMarkerBehavior extends BehaviorBase<GroupingMarker> {
      public GroupingMarkerBehavior(final GroupingMarker control) {
      super(control);
    package org.notebook;
    import javafx.application.Application;
    import javafx.scene.Node;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.TextArea;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class TestGroupingMarker extends Application {
      public static void main(String args[]) {
      launch(TestGroupingMarker.class, args);
      @Override
      public void start(Stage stage) throws Exception {
      VBox vbox = new VBox();
      BorderPane p = new BorderPane();
      VBox first = new VBox();
      first.getChildren().add(makeEntry("In[1]=", "my label", 200.0, true));
      first.getChildren().add(makeEntry("Out[1]=", "the output!", 200.0, true));
      p.setCenter(first);
      p.setRight(new GroupingMarker(true));
      vbox.getChildren().add(p);
      vbox.getChildren().add(makeEntry("In[2]=", "my label 2", 100.0, false));
      Scene scene = new Scene(vbox,500,700);
      scene.getStylesheets().add(TestGroupingMarker.class.getResource("main.css").toExternalForm());
      stage.setScene(scene);
      stage.setTitle("GroupingMarker test");
      stage.show();
      protected Node makeEntry(String io, String text, double height, boolean open) {
      BorderPane pane2 = new BorderPane();
      pane2.setSnapToPixel(true);
      Label label2 = new Label(io);
      label2.getStyleClass().add("io-label");
      pane2.setLeft(label2);
      TextArea area2 = new TextArea(text);
      area2.getStyleClass().add("io-content");
      area2.setPrefHeight(height);
      pane2.setCenter(area2);
      GroupingMarker marker2 = new GroupingMarker();
      marker2.setOpen(open);
      pane2.setRight(marker2);
      return pane2;

    The test interfaces are already defined for you - the 3rd party session bean remote/local interfaces.
    It is pretty trivial to create implementations of those interfaces to return the test data from your XML files.
    There are a number of ways to handle the switching, if you have used the service locator pattern, then I would personally slot the logic in to the service locator, to either look up the 3rd party bean or return a POJO test implementation of the interface according to configuration.
    Without the service locator, you are forced to do a little more work, you will have to implement your own test session beans to the same interfaces as the 3rd party session beans.
    You can then either deploy them instead of the 3rd party beans or you can deploy both the test and the 3rd party beans under different JNDI names,and use ejb-ref tags and allow you to switch between test and real versions by changing the ejb-link value.
    Hope this helps.
    Bob B.

  • Help for a complete numpty

    I'm hoping that some kind soul will take pity on me before I tear the last remaining strands of hair from my head. I've read lots of posts on this very helpful forum and have tried various things, but am now so confused that I think I need to try and clear my head and start from the very beginning.
    I live in Cyprus where, three years ago, wireless modems were non-existant. So, I purchased a WRT300N Broadband Router and a WRE54G Range Expander and like magic, I suddenly had wireless capability all over the house and garden by connecting the router to the ISP's modem, and by siting the Range Expander downstairs.
    Six months ago, the modem stopped working and was replaced by a new one - with wireless functionality. So, I stopped using the WRT300N and just plugged the Range Expander in downstairs whenever I wanted wi-fi on the ground floor. However, that didn't work too well as I kept getting a red light. For the past week, I have been trying to "fix" things, or at least investigate whether or not the Range Expander is broken.
    Today has been a nightmare. Tried installing the WRT300N which I thought I had (lights all working etc) but there's no little Linksys icon appearing in the bottom right of my monitor so is it really installed? And if not, why not? Did all the right things as per the guides with no problems.
    Range Expander won't get past "Site Survey Failed" no matter what I do although I haven't yet tried jumping on it - came close a few times though.
    First dim-witted question; will the Range Expander work without the WRT300N? Could it be configured to work directly with the modem, bypassing the WRT300N?
    Second dim-witted question: are there certain modems that the WRT300N doesn't work with? Perhaps I have one of them?
    Thank you in advance to anyone who has the patience to take me on - this could be a long process....................

    WRE54G will not work without the Router..Check this compatibility link for WRE54G.
    WRT300N will work with all the modem,if the modem has Ethernet Port. 

  • SQL Help for System Analysis

    Hi all,
    Can we seek for help in SQL?
    I have an system analysis which calculate the concurrent usage of a computer system.
    I have add all data which is stored in .CSV file and then insert into a table named as Activity.
    Can we select the data from activity and generate an Excel file which report the calculation on the concurrent usage of a computer system?

    fionanycheng wrote:
    Hi all,
    Can we seek for help in SQL?
    I have an system analysis which calculate the concurrent usage of a computer system.
    I have add all data which is stored in .CSV file and then insert into a table named as Activity.
    Can we select the data from activity and generate an Excel file which report the calculation on the concurrent usage of a computer system?
    So, you have data in a .csv file
    Then you load that data into a relational database.
    Now you want to select that data and place it back into a file for Excel ......
    Hmm..   Makes me wonder why you bothered with the database in the middle.
    the database itself is more than capable of efficiently performing your calculations (assuming a reasonably rational table design).
    Maybe you could provide a better description of the business problem to be solved, instead of a pre-conceived (and possibly ill-conceived) technical solution to that unspecified business problem.  The we could provide better advice.

  • SQL Help for Date Range display

    Gurus,
    I have a sql statement like
    select MIN(HIREDATE), MAX(HIREDATE) FROM EMP WHERE DEPTNO = 30My output looks like
    MIN(HIREDATE)     MAX(HIREDATE)
    12/30/1998        12/30/2001Based on the values of MIN(HIREDATE) , MAX(HIREDATE) values
    I need a SQL to generate the output like
    12/30/1998
    1/30/1999
    2/28/1999
    until Max(HIREDATE) value
    In Feb we dont have 30th day, In that case take the last day of the month.
    Thanks for great help
    C 007

    With 10g.
    Regards Salim.WITH t AS
         (SELECT min(hiredate) min_hiredate,
                 max(hiredate) max_hiredate
            FROM emp_test
            where deptno=30)
    SELECT min_hiredate dt
      FROM t
    model
    dimension by ( 1 rn)
    measures(min_hiredate,months_between(max_hiredate,min_hiredate) diff )
    (min_hiredate[for rn from 1 to diff[1] increment  1]=add_months( min_hiredate[1],cv(rn)-1))
    order by rn
    SQL> WITH t AS
      2       (SELECT min(hiredate) min_hiredate,
      3               max(hiredate) max_hiredate
      4          FROM emp_test
      5          where deptno=30)
      6  SELECT min_hiredate dt
      7    FROM t
      8  model
      9  dimension by ( 1 rn)
    10  measures(min_hiredate,months_between(max_hiredate,min_hiredate) diff )
    11  (min_hiredate[for rn from 1 to diff[1] increment  1]=add_months( min_hiredate[1],cv(rn)-1))
    12  order by rn
    13  /
    DT
    1998-12-30
    1999-01-30
    1999-02-28
    1999-03-30
    1999-04-30
    1999-05-30
    1999-06-30
    1999-07-30
    1999-08-30
    1999-09-30
    1999-10-30
    1999-11-30
    1999-12-30
    2000-01-30
    2000-02-29
    2000-03-30
    2000-04-30
    2000-05-30
    2000-06-30
    2000-07-30
    2000-08-30
    2000-09-30
    2000-10-30
    2000-11-30
    2000-12-30
    2001-01-30
    2001-02-28
    2001-03-30
    2001-04-30
    2001-05-30
    2001-06-30
    2001-07-30
    2001-08-30
    2001-09-30
    2001-10-30
    2001-11-30
    SQL> 

  • IPad sql error for a complete dummy

    i have been using a website for weeks and until today there has been no problem. I'm now getting an error message and have no idea why. Have tried completely restoring ipad but to no avail. I'm not technically minded in sql code and scripts etc but am able to use ipad and follow any instructions to fix this.
    error message says "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)"
    please help

    That is a problem on the website and not your iPad. Can confirm by doing the same transaction on a computer-based browser. Will need to contact whatever support the website has and wait till they fix it over there.
    IF it works on a computer browser (such as Firefox or Internet Explorer), then maybe they changed something and made the site unworkable for the iPad's Safari browser. Can try downloading and using a different browser on the iPad, such as Chrome, Opera, Apollo, Mercury, all for free.
    The iPad does not have or run a local MySQL server.

  • Help for a mac beginner?

    A few years ago i was given a Blue & White PowerMac G3 as part of my "severance" when the web-dev company I worked for went out of business. It's been hanging around unused since then. I'm looking to use it strictly for writing projects and email -- nothing fancy. But I need to do some upgrades on it just to get the internet hookup. What route do I need to go to be able to get online and run MS Office 2001? Thanks for your help!
    Here are the specs --
    B/W PowerMac G3
    384MB
    PPC G3
    350MHz
    OS 8.6
    Two (2) internal hard drives of 6GB each.
    Apps: Illus 9, Photoshop 6, ATM Deluxe, BBEdit 5, Dreamweaver 3, Flash 4 & 5, Quark 4, InDesign 1.5, MS Office 2001
    Help!
    B/W G3   Mac OS 8.6 or Earlier  

    Hi, Brooklynmambo -
    Welcome to Apple's Discussions.
    But I need to do some upgrades on it just to get the internet hookup.
    What might those be?
    There are many folk still running OS 8.6 who have no problem getting on line, even using DSL. If your ISP has some specific requirements, please advise what those might be.
    The first thing to do, while it still has OS 8.6 on it, is to make sure the firmware on it has been updated. It is needful to do that before any late versions of OS 9 can be installed, and before installing OSX. You can download the applicable firmware updater from this Apple KBase page -
    Article #86117 - Firmware Updates
    Note - it's a good idea to print out the included instructions before updating the firmware.
    Once that is done, your machine should be good to go for all versions of OS 9, as is.
    However, it would not hurt to increase the RAM - adding one more 256MB module (which is the largest a B&W G3 can use) would be best; two of those would not hurt, especially if you plan to go on to OSX.
    Re going on to OSX -
    Your machine is rated for all versions of OSX released to date; it would be well to not consider any OSX version earlier than OSX 10.2. OSX 10.3 is probably one of the better choices for that model.
    You might want to consider replacing one of the two hard drives with a larger one, for use with OSX - it needs about 3GB of drive space to install, and runs best when there is at least 5GB of free space left afterwards.

  • SQL Help for a computation

    Hi
    I am trying to create a Stock Market Technical Indicator named - Commodity Channel Index (CCI)
    Date  High_Price     Low_Price     Close_Price     True_Price     TPMA     MD
    02-Jan-07     2297     2238     2273     2269               
    03-Jan-07     2320     2273     2311     2301               
    04-Jan-07     2325     2275     2285     2295               
    05-Jan-07     2305     2256     2275     2279               
    08-Jan-07     2280     2193     2206     2226     2274     21     
    09-Jan-07     2235     2173     2190     2200     2260     38     
    10-Jan-07     2200     2153     2164     2173     2234     42     
    11-Jan-07     2215     2095     2183     2164     2208     35     
    12-Jan-07     2232     2200     2223     2218     2196     22     
    15-Jan-07     2248     2230     2243     2240     2199     24     
    16-Jan-07     2250     2216     2222     2229     2205     29     
    17-Jan-07     2245     2197     2205     2216     2214     20     
    Where Date, HighPrice,LowPrice,CLosePrice is the input from a table
    Below is the computation of other columns
    True_Price = (HighPrice+LowPrice+Closeprice)/3
    TPMA = 5 Days Average True_Price (last 5 values of True_Price includeing the current) [Note:First 4 values will be 0/Null ]
    MD = ABS(TPMA[5]-True_Price[5]) + ABS(TPMA[5]-True_Price[4]) + ABS(TPMA[5]-True_Price[3])+ ABS(TPMA[5]-True_Price[2])+ ABS(TPMA[5]-True_Price[1]) [Note:First 4 values will be 0/Null ]
    Please note this 5 days average is a parameter so it can be 5 days , 10 day, 20 day etc so the calculation will based on this parameter+
    For Example if parameter is 10 days then
    TPMA = 10 Days Average of True_Price(last 10 values of True_Price includeing the current) [Note:First 9 values will be 0/Null ]
    MD = ABS(TPMA[10]-True_Price[10]) ABS(TPMA[10]-True_Price[9]) ABS(TPMA[10]-True_Price[8]) ABS(TPMA[10]-True_Price[7]) ABS(TPMA[10]-True_Price[6]) ABS(TPMA[10]-True_Price[5]) ABS(TPMA[10]-True_Price[4]) + ABS(TPMA[10]-True_Price[3])+ ABS(TPMA[10]-True_Price[2])+ ABS(TPMA[10]-True_Price[1]) [Note:First 9 values will be 0/Null ]
    I am really struck with computation of column MD and not sure how to make it generic to work for any value
    Thanks in advance for your help
    Regards
    Rakesh

    Hi
    I am trying to create a Stock Market Technical Indicator named - Commodity Channel Index (CCI)
    Date  High_Price     Low_Price     Close_Price     True_Price     TPMA     MD
    02-Jan-07     2297     2238     2273     2269               
    03-Jan-07     2320     2273     2311     2301               
    04-Jan-07     2325     2275     2285     2295               
    05-Jan-07     2305     2256     2275     2279               
    08-Jan-07     2280     2193     2206     2226     2274     21     
    09-Jan-07     2235     2173     2190     2200     2260     38     
    10-Jan-07     2200     2153     2164     2173     2234     42     
    11-Jan-07     2215     2095     2183     2164     2208     35     
    12-Jan-07     2232     2200     2223     2218     2196     22     
    15-Jan-07     2248     2230     2243     2240     2199     24     
    16-Jan-07     2250     2216     2222     2229     2205     29     
    17-Jan-07     2245     2197     2205     2216     2214     20     
    Where Date, HighPrice,LowPrice,CLosePrice is the input from a table
    Below is the computation of other columns
    True_Price = (HighPrice+LowPrice+Closeprice)/3
    TPMA = 5 Days Average True_Price (last 5 values of True_Price includeing the current) [Note:First 4 values will be 0/Null ]
    MD = ABS(TPMA[5]-True_Price[5]) + ABS(TPMA[5]-True_Price[4]) + ABS(TPMA[5]-True_Price[3])+ ABS(TPMA[5]-True_Price[2])+ ABS(TPMA[5]-True_Price[1]) [Note:First 4 values will be 0/Null ]
    Please note this 5 days average is a parameter so it can be 5 days , 10 day, 20 day etc so the calculation will based on this parameter+
    For Example if parameter is 10 days then
    TPMA = 10 Days Average of True_Price(last 10 values of True_Price includeing the current) [Note:First 9 values will be 0/Null ]
    MD = ABS(TPMA[10]-True_Price[10]) ABS(TPMA[10]-True_Price[9]) ABS(TPMA[10]-True_Price[8]) ABS(TPMA[10]-True_Price[7]) ABS(TPMA[10]-True_Price[6]) ABS(TPMA[10]-True_Price[5]) ABS(TPMA[10]-True_Price[4]) + ABS(TPMA[10]-True_Price[3])+ ABS(TPMA[10]-True_Price[2])+ ABS(TPMA[10]-True_Price[1]) [Note:First 9 values will be 0/Null ]
    I am really struck with computation of column MD and not sure how to make it generic to work for any value
    Thanks in advance for your help
    Regards
    Rakesh

  • GetYear help for a complete noob

    Hey.
    I'm creating a sql data set for my data model that goes like this:
    select     "Credit Memo"."Cm Fecha Creacion" as "Cm Fecha Creacion",
         "Medidas CM (Nivel RF)"."Cm Monto Total" as "Cm Monto Total",
         "Medidas RF (Nivel RF)"."Rf Monto Total" as "Rf Monto Total"
    from     "SAG"."Medidas RF (Nivel RF)" "Medidas RF (Nivel RF)",
         "SAG"."Medidas CM (Nivel RF)" "Medidas CM (Nivel RF)",     
         "SAG"."Credit Memo" "Credit Memo"
    where YEAR("Credit Memo"."Cm Fecha Creacion") = YEAR(:p_year)
    but i get into 2 errors when doing this.
    1)When saving the data set The YEAR(:p_year) errors out
    2)If I put where YEAR("Credit Memo"."Cm Fecha Creacion") = :p_year (no year function on the right side)
    it saves but when running the xml data samle I get "parsing error"
    I've went thought this forum. And i got to post recommending function like <?xdoxslt:get_year(‘2000-04-08’, $_XDOLOCALE)?>.
    I have no clue where I can put them, its clear that SQL editor is not the place, right?.
    Is there any XML editor for my data sets. Is the "code" view intended for this? How could I use it in that case?
    Thanks!

    Hi LD.
    Thanks for the reply.  My MacBook won't even recognise the Time Capsule, I've messed about with the netowrk settings too much I think. 
    I'm really really stuck.

  • DIV Confusion... Basic help for a measly beginner

    Hi all..
    Tried   searching but couldn't find anything - perhaps due to my lack of   knowledge of what terms to search for, so apologies if something like   this has been posted :S
    I am making my first website   myself after watching and learning from others. Everything is going   great... except I am having trouble getting my footer div to stick to   the bottom of my browser window but still stick to the white content area. I have tried using fixes on the internet but I'm not quite sure where to put bits of code...
    You can view my site (in progress) here:
    http://westcoastbushire.com.au/home.php
    Can anyone help please?!

    Everything is going   great... except I am having trouble getting my footer div to stick to   the bottom of my browser window but still stick to the white content area. I have tried using fixes on the internet but I'm not quite sure where to put bits of code...
    If it is the footer you are concerned about then I suggest try the trick given in this article:
    <http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page>
    Let us know if this solved your problem.
    Good luck.

  • Time Capsule help for a complete noob to MacBook

    Hi everyone
    This is been killing me for about 2 months.  Currently living in an annex down the end of my girlfriends fathers garden.  The wifi doesn't reach so I got a Time Capsule so I could use it as a router.
    We've got a cable and it's run from the Time Capsule, down the garden, into the house and plugged into router in the house.
    That's where I'm now stuck.  I've messed about with it and now my Macbook AirPort won't even recognise my Time Capsule.
    This really needs to be in moron terms as I'm clueless.  I've spent all this money and can't get it to do what I wanted it to do.
    Any help is appreciated, so thanks in advance.

    Hi LD.
    Thanks for the reply.  My MacBook won't even recognise the Time Capsule, I've messed about with the netowrk settings too much I think. 
    I'm really really stuck.

Maybe you are looking for

  • Need HD for Macbook Air 2009. Best options for SSD?

    I have one of the clunky Hitachi HDDs with LIF connector. I see that there aren't many normal SATA options apart from OWC, which provides a SATA HDD with their own special proprietary cable to connect to the logic board. Does anyone know if there are

  • Chapter id's

    here when collecting the chapter ids for all the materials my client have given me 3 materials with same chapter ids Pls guide me how to maintain that... Is that is the thing where system understand that the material is a exciseable material or not..

  • Missing hard disk space after sims 3 force quit

    Hi, I failed to notice I had to update to the latest version of Leopard to install the game with the result that the installer got stuck repeatedly half way through and I could only force quit the installer. The downside to this is that I did this tw

  • PDF Distiller Error

    I have been trying to help my co-worker fix the below distiller error unsuccessfully for the past day.  When printing a pdf with tags and bookmarks, the pdf file gives an error in NotePad and the pdf fails to print.  I've searched some forums and hav

  • Performance Question : Swap File on SSD

    In the past I've stored my swap file on a non-system disk. Now, however, my system disk is an SSD and the competition between system swaps and Photoshop swaps should be reduced if not eliminated. At least, that's what I think. I have other physical h