<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><DIV></DIV>
<DIV>Assuming that "res_table"&nbsp;is the primary table you created for the view, then "skilltable" would be a&nbsp;Relationship that you would define in that section of the view.</DIV>
<DIV>&nbsp;</DIV>
<DIV>All the fields&nbsp;in the WHERE clause&nbsp;are "filters," which you would "expose" to the user.&nbsp;<BR>&nbsp;</DIV>
<P><FONT color=#ff007f size=4 face="bookman old style, new york, times, serif"><EM><STRONG>Nancy</STRONG></EM></FONT></P>
<P>&nbsp;</P>
<P><FONT face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</FONT></P>
<DIV><BR></DIV>
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 12pt"><BR>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Austin Einter &lt;austin.einter@gmail.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> support@drupal.org; development@drupal.org<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Fri, April 8, 2011 10:27:32 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [support] Doubts on VIEWS &amp; DATA module - please help me<BR></FONT><BR>
<DIV>Hi All</DIV>
<DIV>I have around 5 different tables containing employee records (Name, skill set , current company, years of experience etc).</DIV>
<DIV>I am trying to show the employee records for different kind of search. </DIV>
<DIV>&nbsp;</DIV>
<DIV>One seacrh may be, show all the employees&nbsp;having &nbsp;knowledge on PHP and must have 5+ years of experience.</DIV>
<DIV>I know, I need to a database query and show it in a view (either a page or block display).</DIV>
<DIV>&nbsp;</DIV>
<DIV>I know how to collect the records. The query will be something like this.</DIV>
<DIV>&nbsp;</DIV>
<DIV>SELECT <A href="http://res_table.name/" rel=nofollow target=_blank>res_table.name</A>, res_table.yrsexp, res_table.emailid<BR>&nbsp;&nbsp;&nbsp;&nbsp;FROM res_table<BR>&nbsp;&nbsp;&nbsp;&nbsp;WHERE (res_table.yrsexp &gt;= 5 AND skilltable.userid = $user-&gt;userid AND skilltable.skill = 'PHP') <BR></DIV>
<DIV>Or even in some cases I need to go for JOIN.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Somebody suggested to use Data module for it. I gave a try, I am just seeing tables (in view creation), not sure how do I&nbsp;impose the custom SQL query.</DIV>
<DIV>Is it really possible to impose above kind of sql query using Data module???</DIV>
<DIV>&nbsp;</DIV>
<DIV>Or is it the best way to go for custom module and implement _alter_view or _pre_exute_view hooks.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Regards</DIV>
<DIV>Austin</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></DIV></DIV></div></body></html>