Re: query

anonymous_at_discussions.microsoft.com
Date: 05/18/04

  • Next message: CharlieAF: "Find and replace text in all tables in database"
    Date: Mon, 17 May 2004 22:24:05 -0700
    
    

    Thank you, Hugo.
    >-----Original Message-----
    >On Thu, 13 May 2004 02:18:23 -0700, Freger wrote:
    >
    >>Hi
    >>
    >>I have a column in an SQL table. the column is all
    numeric
    >>data from 100 to more than 400. I would like to convert
    >>the data in this column to something else. e.g.
    >>
    >>micro = <200
    >>mini = between 200 and 300
    >>midi = between 300 and 400
    >>full > 400
    >>
    >>can anyone advise me how to write a query to establish
    the
    >>above task.
    >>
    >>Thank you.
    >>
    >>Freger
    >
    >Hi Freger,
    >
    >This can be accomplished using CASE:
    >
    > SELECT CASE
    > WHEN (NumericData <= 200)
    > THEN 'Micro'
    > WHEN (NumericData <= 300)
    > THEN Mini'
    > WHEN (NumericData <= 400)
    > THEN 'Midi'
    > ELSE 'Full'
    > END AS ColumnAlias
    > FROM YourTable
    >
    >Replace column and table names as appropriate.
    >
    >Best, Hugo
    >--
    >
    >(Remove _NO_ and _SPAM_ to get my e-mail address)
    >.
    >


  • Next message: CharlieAF: "Find and replace text in all tables in database"

    Relevant Pages

    • Re: query
      ... >I have a column in an SQL table. ... Hi Freger, ... Best, Hugo ... (Remove _NO_ and _SPAM_ to get my e-mail address) ...
      (microsoft.public.sqlserver.mseq)
    • query
      ... I have a column in an SQL table. ... midi = between 300 and 400 ... can anyone advise me how to write a query to establish the ... Freger ...
      (microsoft.public.sqlserver.mseq)
    • Re: DBMS and lisp, etc.
      ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
      (comp.lang.lisp)
    • Re: Populating a list -- table structure?
      ... I had made a report already and figured out about adding the ... your responce below, but thanks to your help with SQL, I was able to get the ... It takes a summary from a select query and gives the ... KitID, long integer ...
      (microsoft.public.access.forms)
    • How do I do Paging through a large dataset via Stored Procedures
      ... Paging by dynamically altering the SQL Query ... Create stored procedures ... SELECT * FROM STUDENTS ...
      (microsoft.public.dotnet.framework.adonet)