Tricky SQL query!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Malc

    #1

    Tricky SQL query!

    I am writing an application which produces labels for an overnight
    Courier Company. In the mySQL database I have a field called 'NOP'
    which records the 'number of pieces' for each consignment.

    I have to produce one lable for each piece that is being shipped. The
    label production module currently accepts an SQL query and prints one
    label per returned row.

    Does anyone know if it is possible to write a select query which would
    produce a row based on the 'NOP' field? Imagine the following records

    NOP Destination
    --- -----------
    1 London
    1 Manchester
    2 Glasgow

    In this example, the Glasgow row would be repeated so that two labels
    would be printed.

    Any help appreciated.

    Malc.
Working...