Hi!
I’m doing one Project in vb.net 2008 using mysql .In that
Project have the following Issues..
1.if one Employee getting Salary 1.2 lacs / annum means ..
After he getting 1st month Salary i want to show remaining
11 month salary.. How can i Create Trigger for this Problem
& How can i use it..
Answer / ram gopal verma
select * from employee where empdate BETWEEN DATE_FORMAT(NOW(), '%Y-01-%d') AND DATE_FORMAT(NOW() ,'%Y-05-%d')
Note- I u want (%Y-01-%d) means show February month to (%Y-05-%d) June months.
Is This Answer Correct ? | 1 Yes | 0 No |
How to Creating a new user. Login as root. Switch to the MySQL db. Make the user. Update privs.
Is microsoft sql same as mysql?
How can you find out the version of the installed mysql?
What is Foreign Key? What is the main difference between primary key and Foreign Key ? How Foreign Key can be defined? Is Foreign key is used to join two or more table?
how to get only updated, deleted , inserted records after certain interval time in mysql with out using triggers...
What do ddl, dml, and dcl stand for?
Can mysql function return a table?
How to shut down the server with 'mysqladmin'?
Can you tell the difference between mysql_fetch_object and mysql_fetch_array?
How can a user get the current SQL version?
Is mysql query case sensitive?
mysql> select * from store; +------+-------+-------+ | id | month | sales | +------+-------+-------+ | 1 | 1 | 100 | | 1 | 2 | 100 | | 1 | 3 | 200 | | 1 | 4 | 300 | | 1 | 5 | NULL | | 1 | 6 | 200 | | 1 | 7 | 800 | | 1 | 8 | 100 | | 1 | 9 | 240 | | 1 | 10 | 140 | | 1 | 11 | 400 | | 1 | 12 | 300 | | 2 | 1 | 300 | | 2 | 2 | 300 | | 2 | 3 | 300 | | 2 | 4 | 200 | | 2 | 5 | 200 | | 2 | 6 | 200 | | 2 | 7 | 100 | | 2 | 8 | 100 | | 2 | 9 | 300 | | 2 | 10 | 100 | | 2 | 11 | 150 | | 2 | 12 | 150 | +------+-------+-------+ this is my table. i need to display output like this. +------+----------+----------+----------+----------+ | id | quarter1 | quarter2 | quarter3 | quarter4 | +------+----------+----------+----------+----------+ | 1 | 400 | 500 | 1140 | 840 | | 2 | 900 | 600 | 500 | 400 | +------+----------+----------+----------+----------+ what single query i have to write for this. i tried this query and it displays like the below mysql> select id,sum(sales) as quarter1,(select sum(sales) from store where mont h>3 and month<7 ) as quarter2,(select sum(sales) from store where month>6 and mo nth<10)as quarter3 from store where month>0 and month<4 group by id; +------+----------+----------+----------+ | id | quarter1 | quarter2 | quarter3 | +------+----------+----------+----------+ | 1 | 400 | 1100 | 1640 | | 2 | 900 | 1100 | 1640 | +------+----------+----------+----------+ 2 rows in set (0.00 sec) tel me how to rectify it.