SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: DB Question

  1. #1
    SitePoint Zealot Da Mouse's Avatar
    Join Date
    Aug 2002
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    DB Question

    I am DaMouse
    Nobody can beat me so long as I'm stubborn -DaMouse
    Squeak

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    okay, i saw the question, but i don't understand it
    how can I make it so if a string comes up in a database column more than once it becomes one
    so say

    col col2
    xx aa
    xx bb
    xx cc
    xx dd

    xx only comes up once
    and say I've got a blank field how can I make that not show-up
    what does "comes up once" mean? you want to eliminate duplicates? which row of xx should stay behind?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Zealot Da Mouse's Avatar
    Join Date
    Aug 2002
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What I intended was when the first one showed up that got defined to an array at point 0 and then the duplicates are left all must be in ASP(VBscript)
    I am DaMouse
    Nobody can beat me so long as I'm stubborn -DaMouse
    Squeak

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    array? why an array? you can do what you want in sql

    by "first" do you mean the duplicate col with the lowest value of col2?

    there is no inherent order in a relational database table -- you have to sort on some column
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Zealot Da Mouse's Avatar
    Join Date
    Aug 2002
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its supposed to be a asp script that builds a array

    e.g.

    xx yy 00
    xx ww 01
    xx pp 99

    it prints out javascript e.g.

    xx = new Array("yy","ww","pp");
    yy = new Array("00");
    ww = new Array("01");
    pp = new Array("99");

    and only those columns called

    Make Type Dates

    Thanks In Advance DaMouse
    I am DaMouse
    Nobody can beat me so long as I'm stubborn -DaMouse
    Squeak

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    i don't think you are asking a database question

    can you please show your table layout, your query, and what, if anything, you would like to change about the output that the query is currently returning

    rudy
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    SitePoint Zealot Da Mouse's Avatar
    Join Date
    Aug 2002
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok I don't have an SQL query yet but I want to find one that does that sort of thing
    I am DaMouse
    Nobody can beat me so long as I'm stubborn -DaMouse
    Squeak

  8. #8
    SitePoint Zealot Da Mouse's Avatar
    Join Date
    Aug 2002
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found a way use DISTINCT it only selects one of a kind
    I am DaMouse
    Nobody can beat me so long as I'm stubborn -DaMouse
    Squeak


Bookmarks

Posting Permissions

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