Thanks Richard. But I am getting an error like near ( syntax error.

Pragma table_info(a.name)

On Fri, Sep 28, 2018, 6:21 AM Richard Hipp <d...@sqlite.org> wrote:

> On 9/27/18, Revathi Narayanan <revathi...@gmail.com> wrote:
> > Hi,
> >
> > I have one requirement like I want to display all the table names for the
> > given column name.
> >
> > Ex: If the table T1 and T2 has column names like C1 then it should
> display
> > both the table names T1 and T2.
> >
> > I tried to execute the query using sqlitemaster. But it's displaying only
> > table names not column names.
>
> Let the column name be in the variable $c1
>
>    SELECT a.name
>    FROM sqlite_master AS a
>    JOIN pragma_table_info(a.name) AS b
>    WHERE a.type='table'
>    AND b.name=$c1;
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to