Results 1 to 4 of 4

Thread: How Do i combine this two queries Help(Addition to the below one

  1. #1
    Join Date
    Apr 2007
    Posts
    14

    How Do i combine this two queries Help(Addition to the below one

    have a Query that is workng well
    select * from property
    where
    substring(func_key,1,5) = 'GEOSS' And substring(func_key,6,8)>= 3

    it Display all the records that has 'GEOSS' and has a functional key that is equal to 3 and greater than 3. the Query is working.

    NB:* The 'GEOSS' Records are Subtyptes of PVOOOOOO Records. It means that the main Key will be like '022100550.PV000000' and the Subtypes will be
    '022100550.GEOSS001
    '022100550.GEOSS002
    '022100550.GEOSS003
    Those are subtypes of 022100550.PV000000. above SQL statement searches them and Exclude the main key, i need a separate key that will show all main keys of the subkeys. that means all the PV000000 that has Sub keys GEOSS.


    select * from property
    where
    substring(func_key,1,5) = 'GEOSS'

    And substring(func_key,6,8)>= 3 and

    where substring(func_key,9,16)='PV000000'
    And Attrib_code = substring(Attrib_code,5,2)=16

    All this above query can get me what i want,but SQl you kow will never allow such query


    Vuyiswa

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Your query is fine except the extra WHERE,

    select * from property
    where substring(func_key,1,5) = 'GEOSS'
    And substring(func_key,6,8)>= 3
    and substring(func_key,9,16)='PV000000'
    And substring(Attrib_code,5,2)=16

  3. #3
    Join Date
    Apr 2007
    Posts
    14

    Thanks man

    can you please help me with the Following one

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    Which one?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •