Jump to content

rickoverman

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rickoverman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all, I have been busy with the code you all have provided, and i believe i got it to work now. I adapted the query so that it can handle more than 2 pricecharts in a sequence. and only returns the specified pricecharts. SELECT table4.* FROM table4 JOIN ( SELECT srvid, MIN(field(pricecart,'GRP','PRI')) as tc FROM table4 GROUP BY srvid ) AS h2 ON ( (table4.pricecart='PRI' OR table4.pricecart='GRP') AND table4.srvid=h2.srvid AND field(table4.pricecart,'GRP','PRI')=h2.tc ); Thanks for all the help!
  2. Hi Wildbug, didn't try the group_concat yet but will today. Thanks for your reply!
  3. Hello Everyone, I have a problem with a query I have the following table tb1: id name pricechart ordernr srvid --------------------------------------------- 1 rick hotel GRP 2 1 2 rick hotel PRI 1 1 3 Jonas Hotel GRP 2 2 4 Jonas Hotel PRI 1 2 5 Allan Hotel PRI 1 1 now what i want to have as result are all the distinct names with a specific pricechart, the pricechart has to be either PRI or GRP and followed up by some sequence. like for example if GRP pricechart is not available then display the PRI. a result for the above described sequence (GRP -> PRI ) will result in the following: id name pricechart ordernr srvid --------------------------------------------- 1 rick hotel GRP 2 1 3 Jonas Hotel GRP 2 2 5 Allan Hotel PRI 1 1 OR if the sequence is turned around like display first PRI if the pricechart is there else use the GRP (PRI -> GRP) the folllwoing result would be displayed: id name pricechart ordernr srvid --------------------------------------------- 2 rick hotel PRI 1 1 4 Jonas Hotel PRI 1 2 5 Allan Hotel PRI 1 1 Can anyone help me? I tried it now multiple times myself but without any luck Thanks in advance! Rick
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.