It should be done as follows:
SELECT @x:= @x + 1 AS rank, title FROM t1 JOIN ( SELECT @x:= 0 )X ORDER BY weight
It should be done as follows:
SELECT @x:= @x + 1 AS rank, title FROM t1 JOIN ( SELECT @x:= 0 )X ORDER BY weight
It can be done as follows:-
SELECT * FROM table_name ORDER BY FIELD(filed_name,
"value_y"
,"value_x") DESC
It’s as follows :-
UPDATE table1 a INNER JOIN table2 b ON a.task_id = b.task_id SET a.column='val' b.column=UNIX_TIMESTAMP(CONVERT_TZ(CURRENT_TIMESTAMP,'+05:30','+00:00')) WHERE a.task_id='1024' AND b.task_id='1024'
It’s as follows…
INSERT INTO table2 SELECT * FROM table1;
or to copy a few columns
INSERT INTO table2 (column_name(s)) SELECT column_name(s) FROM table1;
They can also be written as follows
SELECT column_name(s) INTO newtable [IN externaldb] FROM table1;
or to copy a few columns
SELECT column_name(s) INTO newtable [IN externaldb] FROM table1;
It can be done as follows :
SELECT * FROM `table_name` WHERE `request_id` IN ('value1','value2','value3','value4');
The benefit of using IN()
is that it can process data more faster than using OR
condition.
You must be logged in to post a comment.