| | |
sql query
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
i have three table
1st viewleave
2nd applyleave
3rd personal
based on the leaveid in viewleavetable i wnt to fetch the spid in the second table,based on the spid i want to select spid email address........please tell how to do tat..
CREATE TABLE `viewleave` (
`leaveid` varchar(25) NOT NULL,
`message` varchar(500) NOT NULL
)
CREATE TABLE `applyleave` (
`leaveid` int(11) NOT NULL auto_increment,
`spid` varchar(25) NOT NULL
PRIMARY KEY (`leaveid`)
)
CREATE TABLE `personal` (
`spid` varchar(25) NOT NULL,
`email` varchar(60) NOT NULL,
)
1st viewleave
2nd applyleave
3rd personal
based on the leaveid in viewleavetable i wnt to fetch the spid in the second table,based on the spid i want to select spid email address........please tell how to do tat..
CREATE TABLE `viewleave` (
`leaveid` varchar(25) NOT NULL,
`message` varchar(500) NOT NULL
)
CREATE TABLE `applyleave` (
`leaveid` int(11) NOT NULL auto_increment,
`spid` varchar(25) NOT NULL
PRIMARY KEY (`leaveid`)
)
CREATE TABLE `personal` (
`spid` varchar(25) NOT NULL,
`email` varchar(60) NOT NULL,
)
That means there are many records with the same spid. You can change the above query to,
Cheers.
select email from personal where spid IN (select spid from applyleave where leaveid IN (select leaveid from viewleave where leaveid="specify your leaveid here"))Cheers.
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
thanks it is working.........
i have a form where the candidate id,from-date and to-date will be given by the user..based on tat i want to exact data from the table
SELECT * from attend where day1 between '$from' and '$to';
i am able to extract date based on the condition given by the user,i want to exact on a particular id's date...how to do tat
this is my table...........
CREATE TABLE `attend` (
`spid` varchar(50) NOT NULL,
`day1` date NOT NULL,
`time1` varchar(50) NOT NULL
)
i have a form where the candidate id,from-date and to-date will be given by the user..based on tat i want to exact data from the table
SELECT * from attend where day1 between '$from' and '$to';
i am able to extract date based on the condition given by the user,i want to exact on a particular id's date...how to do tat
this is my table...........
CREATE TABLE `attend` (
`spid` varchar(50) NOT NULL,
`day1` date NOT NULL,
`time1` varchar(50) NOT NULL
)
![]() |
Similar Threads
- sql query problem with MS Access and C# (C#)
- Urgent Help with SQL Query (MySQL)
- C# VS 2005 - SQL Query Parameters to an ODBC DataSource (C#)
- sql query updating problem (Visual Basic 4 / 5 / 6)
- Javascript array from sql query (JSP)
- Please help me out with MySQL query (MySQL)
- PHP/SQL query help (PHP)
- Retreiving variables from a sql query into a form (PHP)
Other Threads in the MySQL Forum
- Previous Thread: Selective deletes, help
- Next Thread: Could use some help with nested SELECTS
Views: 1071 | Replies: 8
| Thread Tools | Search this Thread |
Tag cloud for MySQL
"use" 1 agplv3 alfresco amazon api artisticlicense breathalyzer camparingtocolumns changingprices cmg contentmanagement count court crm data database design developer development drupal dui ec2 eliminate email enter enterprise error eudora facebook form foss gartner gnu government gpl greenit groklaw groupware images innerjoins insert ip joebrockmeier join journalism keywords laptop law legal license licensing linux maintenance managing matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource operand oracle pdf penelope php priceupdating referencedesign remove reorderingcolumns resultset saas select sharepoint sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency update virtualization






