If condition in select query / insert /update

If condition in select query / insert /update

am 18.05.2009 06:25:18 von bharani kumar

--000e0cd331de7ee0f7046a282e68
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64

SGkgYWxsICwKCkNhbiB1IGdpdmUgb25lIGV4YW1wbGUgcXVlcnkgLAoKV2hp Y2ggY29udGFpbiB0
aGUgSUYgY29uZGl0aW9uICwKCkJlY2F1c2UgaGVyZSBiZWZvcmUgYW0gbm90 IHVzZWQgdGhlIElG
IGFuZCBhbGwgLAoKClRoYW5rcwoKCi0tIArgrongrpngr43grpXgrrPgr40g 4K6o4K6j4K+N4K6q
4K6p4K+NCuCuquCusOCuo+CuvyAg4K6V4K+B4K6u4K6+4K6w4K+NCgpSZWdh cmRzCkIuUy5CaGFy
YW5pa3VtYXIKClBPU1QgWU9VUiBPUElOSU9OCmh0dHA6Ly9iaGFyYW5pa3Vt YXJpeWVycGhwLnNp
dGU4OC5uZXQvYmhhcmFuaWt1bWFyLwo=
--000e0cd331de7ee0f7046a282e68--

Re: If condition in select query / insert /update

am 18.05.2009 11:49:12 von Janek Bogucki

Hi,

mysql> create table t(i int);

mysql> insert into t values(1),(2),(3);

mysql> select i, if(i <= 1, 'low', 'high') from t order by i;
+------+---------------------------+
| i | if(i <= 1, 'low', 'high') |
+------+---------------------------+
| 1 | low |
| 2 | high |
| 3 | high |
+------+---------------------------+
3 rows in set (0.06 sec)

Take a look at the documentation for IF(),
http://dev.mysql.com/doc/refman/5.0/en/control-flow-function s.html

All the best,
-Janek, CMDEV 5.0.
StudyLink. Helping People Realise Their Potential.
http://studylink.com

On Mon, 2009-05-18 at 09:55 +0530, bharani kumar wrote:
> Hi all ,
>
> Can u give one example query ,
>
> Which contain the IF condition ,
>
> Because here before am not used the IF and all ,
>
>
> Thanks
>
>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: If condition in select query / insert /update

am 18.05.2009 13:07:00 von bharani kumar

--001636e1faec145cac046a2dcb02
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Can u tell me , assume if i use If in the query , then i reduce performance
,

Any idea

On Mon, May 18, 2009 at 3:19 PM, Janek Bogucki
wrote:

> Hi,
>
> mysql> create table t(i int);
>
> mysql> insert into t values(1),(2),(3);
>
> mysql> select i, if(i <=3D 1, 'low', 'high') from t order by i;
> +------+---------------------------+
> | i | if(i <=3D 1, 'low', 'high') |
> +------+---------------------------+
> | 1 | low |
> | 2 | high |
> | 3 | high |
> +------+---------------------------+
> 3 rows in set (0.06 sec)
>
> Take a look at the documentation for IF(),
> http://dev.mysql.com/doc/refman/5.0/en/control-flow-function s.html
>
> All the best,
> -Janek, CMDEV 5.0.
> StudyLink. Helping People Realise Their Potential.
> http://studylink.com
>
> On Mon, 2009-05-18 at 09:55 +0530, bharani kumar wrote:
> > Hi all ,
> >
> > Can u give one example query ,
> >
> > Which contain the IF condition ,
> >
> > Because here before am not used the IF and all ,
> >
> >
> > Thanks
> >
> >
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=3Dbharanikumariyerphp@gma il.com
>
>


--=20
உங்கள் நண=
்பன்
பரணி குமா=
ர்

Regards
B.S.Bharanikumar

POST YOUR OPINION
http://bharanikumariyerphp.site88.net/bharanikumar/

--001636e1faec145cac046a2dcb02--