User Profile

Collapse

Profile Sidebar

Collapse
write2ashokkumar
write2ashokkumar
Last Activity: Aug 7 '08, 09:53 AM
Joined: Feb 16 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • write2ashokkumar
    started a topic Need query.. help me any one...

    Need query.. help me any one...

    Hi,

    i have the table like this,

    +------+-------+-----+
    | city | caste | cnt |
    +------+-------+-----+
    | 1 | 1 | 2 |
    | 1 | 2 | 3 |
    | 2 | 1 | 1 |
    | 2 | 2 | 2 |
    | 3 | 1 | 3 |
    | 3 | 3 | 1 |
    +------+-------+-----+



    i want to select the top caste which is having the most cnt...
    See more | Go to post

  • write2ashokkumar
    started a topic Need query help... urgent plz....

    Need query help... urgent plz....

    Hi,

    i have the table like this,

    +------+------+------+
    | uid | val | type |
    +------+------+------+
    | 1 | 500 | 1 |
    | 1 | 500 | 2 |
    | 2 | 500 | 1 |
    | 2 | 100 | 2 |
    | 3 | 100 | 2 |
    | 4 | 500 | 1 |
    +------+------+------+


    here, type 1 = sales and type 2 = return

    i want to select only the sales record for the users, without...
    See more | Go to post

  • write2ashokkumar
    replied to adding dates, DATEADD function
    Hi, es, your query syntax is worng to add the date. So try with the following query.
    [code=mysql]
    SELECT *
    FROM viajes
    WHERE
    viajes.fecha BETWEEN orderdate AND DATE_ADD(orderd ate,INTERVAL rango DAY);[/code]
    Here,
    [php]rango = $_GET['rango']
    orderdate = $_GET['orderdate'][/php]
    So u can format the query as per the PHP concatination syntax.
    For general, date add function...
    See more | Go to post
    Last edited by ronverdonk; Mar 29 '08, 11:47 AM. Reason: code tags (again)!!

    Leave a comment:


  • write2ashokkumar
    replied to NOT query syntax.
    Hi,

    yes, its correct. so that only we can try with the following query,
    [code=mysql]select * from table1 where col_name like '%regulate%' AND col_name NOT like '%control%';[/code]
    Regards,
    S.Ashokkumar

    Please enclose your posted code in [code] tags (See How to Ask a Question).

    This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for...
    See more | Go to post
    Last edited by ronverdonk; Mar 28 '08, 04:58 PM. Reason: code tags!!

    Leave a comment:


  • write2ashokkumar
    replied to NOT query syntax.
    Hi,

    Try with the following query,
    [code=mysql]select * from table1 where col_name like '%regulate%' AND col_name NOT like '%control%';[/code]
    Regards,
    S.Ashokkumar

    Please enclose your posted code in [code] tags (See How to Ask a Question).

    This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting...
    See more | Go to post
    Last edited by ronverdonk; Mar 28 '08, 04:57 PM. Reason: code tags!!

    Leave a comment:


  • write2ashokkumar
    replied to NOT query syntax.
    Hi,
    One more way is given below,[code=mysql]
    select * from table1 where col_name like '%regulate%' AND col_name NOT like '%control%';[/code]

    Regards,
    S.Ashokkumar

    Please enclose your posted code in [code] tags (See How to Ask a Question).

    This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources,...
    See more | Go to post
    Last edited by ronverdonk; Mar 28 '08, 04:56 PM. Reason: code tags

    Leave a comment:


  • write2ashokkumar
    replied to NOT query syntax.
    Hi,
    Your query syntax is wrong. So try with the following one.
    Query:
    [code=mysql]
    select tbl1.*
    from table1 tbl1
    inner join tlb2 on tb1.primary_id_ col = tbl2.primary_id _col /* Table Self Join Condition */
    where tbl1.col_name like '%regulate%' and
    tbl2.col_name not like '%control%';[/code]

    Regards,
    S.Ashokkumar

    Please enclose your posted code...
    See more | Go to post
    Last edited by ronverdonk; Mar 28 '08, 04:55 PM. Reason: code tags

    Leave a comment:


  • write2ashokkumar
    replied to IF Statement
    Hi,

    i think, u r trying to join the 2 table to get the data from the tables when the user id is available in both tables. But the above join syntax is wrong. Check with the following query, it will help for ur requirement.
    [code=mysql]
    SELECT usr.*
    FROM users usr
    INNER JOIN tsms ts ON usr.id = ts.uid
    WHERE usr.id = <$_REQUEST[2]>;[/code]

    Before try with the...
    See more | Go to post
    Last edited by ronverdonk; Mar 28 '08, 05:02 PM. Reason: code tags

    Leave a comment:


  • write2ashokkumar
    replied to Comma Separated
    Hi yasmine,

    i think, you are using the GUI tool to view the data from the table...
    is it right? while using the some GUI tool, may be we will get the message "BLOB....". like this... so check with some other GUI tool like SQLyog, etc.. or use command line environment in windows / linux. we will get the full data.

    i think, BLOB - 1.0 KB is not a mysql error... its a GUI tool error....
    ...
    See more | Go to post

    Leave a comment:


  • write2ashokkumar
    replied to Comma Separated
    Hi,

    You have mentioned the 2 tables a & b. can u able to give me the table structure of the b table with the field and datatype of the field.

    Consider sid field is integer, If we group contact any integer values, we will get as string like '1,2,3,4,5'. so, we cant store the string value in the integer field. So while copy the table we must need to change the sid field value from integer to text/longtext/blob....
    See more | Go to post

    Leave a comment:


  • write2ashokkumar
    replied to Comma Separated
    Hi,

    Yes, we can store the values as comma separated value. Following example explain you properly and its very simple to understand... i hope...

    Example:


    -- Create table
    -- ============

    mysql> create table content(content varchar(100),si d varchar(100));
    Query OK, 0 rows affected (0.04 sec)

    -- Insert the values to the table
    -- =============== ===============...
    See more | Go to post

    Leave a comment:


  • Hi,

    To take the backup of mysql database table, you can use the following "mysqldump" command.....

    Syntax:
    mysqldump [options] [database_name] [table_name] > <file_store_pat h>;


    Example:

    mysqldump -u root --extended-insert test_db sample_table > /home/backup/table_backup.sq l


    Regards,
    S.Ashokkumar
    See more | Go to post

    Leave a comment:


  • write2ashokkumar
    started a topic Need Help - Memcache with mysql

    Need Help - Memcache with mysql

    hi...

    How to handle memcache with Mysql trigger?

    Reffer : http://mysqlblog.lenox way.net/index.php?/archives/3-MySQL-triggers-and-memcache.html

    Regards,
    S.Ashokkumar.
    See more | Go to post

  • write2ashokkumar
    started a topic Need Query help please...

    Need Query help please...

    hi...

    i have the table like this,

    Table Name : sample
    Total Records : 500000 (Consider like this)

    Sample Records:
    ----------------

    id ------------ name
    =============== =======
    1 -------------- AAA
    2 -------------- BBB
    3 -------------- CCC
    2 -------------- AAA
    3 -------------- AAA
    4 -------------- CCC
    1 --------------...
    See more | Go to post

  • write2ashokkumar
    started a topic Need Query.. Help Please...

    Need Query.. Help Please...

    hi...

    i have the table like this,

    Table Name : sample
    Total Records : 500000 (Consider like this)

    Sample Records:
    ----------------

    id ------------ name
    =============== =======
    1 -------------- AAA
    2 -------------- BBB
    3 -------------- CCC
    2 -------------- AAA
    3 -------------- AAA
    4 -------------- CCC
    1 --------------...
    See more | Go to post

  • write2ashokkumar
    started a topic Need Query... Urgent Please help....

    Need Query... Urgent Please help....

    hi...

    i have the table like this,

    Table Name : sample
    Total Records : 500000 (Consider like this)

    Sample Records:
    Code:
    id ------------ name
    ======================
    1 -------------- AAA
    2 -------------- BBB
    3 -------------- CCC
    2 -------------- AAA
    3 -------------- AAA
    4 -------------- CCC
    1 -------------- BBB
    ...
    See more | Go to post
    Last edited by Atli; Jul 3 '07, 06:39 PM. Reason: Added code tags. (Resistance is futile!)

  • write2ashokkumar
    started a topic Mysql cluster - Index

    Mysql cluster - Index

    hi...

    What are all the types of index supports in Mysql cluster method?

    Regards,
    S.Ashokkumar.
    See more | Go to post

  • write2ashokkumar
    started a topic Fetching ID's that match multiple rows.

    Fetching ID's that match multiple rows.

    hi...

    i have the table like this,

    id --------- name
    --------------------
    1 ---------- xxx
    1 ---------- yyy
    2 ---------- xxx
    3 ---------- xxx
    3 ---------- yyy
    4 ---------- yyy
    5 ---------- zzz

    consider, one id is in more than one name. But,

    I need the output like
    id --------- name
    --------------------
    1 ----------...
    See more | Go to post

  • write2ashokkumar
    replied to IN Clause in Dynamic Query
    hi...

    for do this, u have to use the dynamic sql.
    For example:

    user input value is 456,465,123....

    first build the query lie this

    set @vquery = CONCAT("select * from test_table where table_col in(","456,465,1 23",")");

    prepare stmt from @vquery;
    execute stmt;


    Regards,
    S.Ashokkumar...
    See more | Go to post

    Leave a comment:


  • hi...

    If we use the replace function to replace the new line, it will repalce all the new lines in the string...i dont want to remove the new line between characters. i want to remove from left side and right side of the string only.

    Regards,
    S.Ashokkumar....
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...